[Lazarus] Form in DLL

Michael Schnell mschnell at lumino.de
Wed May 2 13:39:58 CEST 2012

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 

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 

A Form uses the LCL "Application" and thus the "main Thread". Creating a 
second Main Form (-Thread) is not supported by the LCL.


More information about the Lazarus mailing list