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

Phil Hess macpgmr at fastermac.net
Wed Dec 9 01:17:07 CET 2009


What widgetset are you testing? Calling Application.Initialize never worked before on Windows.

On Carbon, an LCL form in a .dylib was working as long as a year ago, but Windows would freeze when the DLL form is displayed.

Thanks.

-Phil

----- "Marco Alvarado" <cronodragon at gmail.com> wrote:

> 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
> 
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




More information about the Lazarus mailing list