[Lazarus] Form in DLL

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu May 3 14:08:35 CEST 2012


Michael Schnell schrieb:

> The DLL has it's own static memory, that is why all the static variables 
> of the LCL instance in the DLL are independent of those in the main 
> program. This it is "dual entry" (or in fact completely independent as 
> the code also is duplicated) regarding two different threads.

That's why I suggested an special TApplication type for DLLs. When used 
by a Lazarus application, the DLL could be instructed to use the main 
Application object and memory manager.

This were close to the Delphi handling of packages, except that shared 
code resides in the application, while it resides in further packages in 
Delphi. This model doesn't prevent code duplication, because the DLL 
could be used by non-Lazarus apps as well. Using another DLL for the LCL 
would solve this, but most probably will fail due to other (RTTI...) 
problems.

DoDi





More information about the Lazarus mailing list