[fpc-pascal] Library callback : how do I do that?

Michael Schnell mschnell at lumino.de
Thu Aug 8 12:52:57 CEST 2013

On 08/08/2013 12:34 PM, Lukasz Sokol wrote:
> Hello,
> I am making a Pascal wrapper for a library, which states in its API description:
> "
> Note that the Callback function will be called from an independent child
> thread, not from the ApplicationÂ’s Window thread. It should not therefore be
> used to draw data directly to a Windows screen. The safest use of the callback
> is to use a threadsafe interface (such as Windows messaging) to pass the
> message to Windows for handling by the Windows thread.
> "
AFAIU: The callback is just a callback. So you can handle it in the 
normal way (either in an application, in a command line tool without a 
main form or in a dll.) You just can't do any GUI stuff in that callback.

I understand that you in fact don't want to do that, anyway.


More information about the fpc-pascal mailing list