[Lazarus] Form in DLL

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Thu May 3 10:22:48 CEST 2012

Michael Schnell wrote:
> Without doing something special a DLL does have it's own memory manager 
> (because the calling program might be not an FPC program and uses an 
> incompatible memory manager) but it does not have it's own Thread 
> (because the original purpose of a DLL is just providing callable 
> functions).
> So you can't (carelessly) pass FPC constructs lice objects or strings to 
> a DLL, because the memory management might fail. There are ways (at 
> least with Delphi) to make a DLL attach to a main programs memory 
> management.
> A Form uses the LCL "Application" and thus the "main Thread". Creating a 
> second Main Form (-Thread) is not supported by the LCL.

So using the LCL, is it possible to e.g. put the code associated with a 
right-button menu in a DLL, and have it interact with e.g. a SynEdit on 
the main form?

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the Lazarus mailing list