[Lazarus] LCL and DLLs, initializing the widget set safely?

Marco Alvarado cronodragon at gmail.com
Tue Dec 8 23:39:10 CET 2009


I'm really happy to inform that I solved the bug, and now I have a
working version of LCL 0.9.28.2 in DLL. It seems the fix might not be
difficult for someone who understands the LCL's internals. I'll
explain what I did hoping someone could work on it.

Somehow an instance of TApplication is being created in DLL, but it's
not being initialized like in .EXE. One just needs to initialize the
widgetset by calling Application.Initialize(). That solves the
exception when creating forms.

The other bug I got was related to TWinControl.CreateParented().
Replaced it by TForm.Create(nil) and Windows.SetParent(), and now
everything is fine.

Also I'm creating the components dinamically after initializing the
Application. I'll test designing forms later.

Best regards!
-Marco




More information about the Lazarus mailing list