[fpc-pascal] C++ > C wrapper callback > Pascal Continues

Peter Vreman peter at freepascal.org
Wed Jul 27 14:26:57 CEST 2005

>>> //------------------------------------
>>> PASCAL WRAPPER function being called is below
>>> DllExport void SetL1Callback(TL1Callback p) { DasApi.m_pL1Callback=p;
>>> };
>>> There  seems to be nothing I can find that would cause a Runtime 217 in
>>> the
>>> layout and now finding C conversion of same is working.
>>> Can anyone else please confirm if this should work, or is a bug report
>>> be
>>> in
>>> order??
>> Peter Vreman wrote:
>> A bug report is only in order if there are complete sources otherwise it
>> can't be reproduced.
>>> Thanks to all, whoever may have additional ideas.     Mike
>> Are the pascal units are initialized? A call to FPC_INITIALIZEUNITS is
>> required otherwise the memorymanager etc. will not work.
> Thank you Peter,
>>From the scant references I have found regarding FPC_INITIALIZEUNITS
>> Peter,
> I would think you have the likely cause.  Unfortunately, the 2.0.0. Docs,
> nor the Web docs make reference to the function, (if it is a function),
> and
> Google seems to have only few examples.
> Where can I find documentation on FPC_INITIALIZEUNITS and is it valid in
> fpc-2.0.0, being the docs don't refer it?

It is an internal function implicitly called by the compiler. It is not
for use by normal users and therefor not in the docs. It also requires a
table with the units to initialize. For a program and library this table
is inserted. If you link a single .o file it will not work.

More information about the fpc-pascal mailing list