[Lazarus] RE : Forms in DLL

Juan Sánchez aldeacity at gmail.com
Mon Aug 8 18:54:54 CEST 2011


I have tried it. From main program, one button call a procedure in a DLL
with a form. Inside this procedure I code this:

Application.Initialize;
Application.CreateForm(TForm2, Form2);
Form2.ShowModal();
Is this Ok?

What I can see is that main window in programa never is blocked so I can
access both modal and main window. If I click twice button to get two modal
windows from DLL, both are modal and now I can access last window created
and main window.


2011/8/8 Ludo Brands <ludo.brands at free.fr>

> **
>
>
> I know that some people asked about this before. But it isn't clear enough
> for me :-) So. Is it possible to include forms or other lcl graphic
> component in a DLL so, for example, a DLL function can create or modify a
> form?
> If it is not possible... There any initiative or way to try to participate
> and code it to get it?
>
>
> Generally speaking, no. The LCL in the dll comes with it's own messagepump
> and you can have only one per process. What works for me: a modal form
> created in a dll. Modal forms are kind of "exclusive" for the process and
> having 2 message pumps isn't a problem. There is an issue when the dll is
> called from MFC. Details and workaround here:
> http://bugs.freepascal.org/view.php?id=19327.
> OSX requires the patch attached to
> http://bugs.freepascal.org/view.php?id=19253.
>
> Ludo
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110808/41b8dea9/attachment-0003.html>


More information about the Lazarus mailing list