[Lazarus] RE : Forms in DLL

Juan Sánchez aldeacity at gmail.com
Mon Aug 15 15:44:50 CEST 2011


Hello again :-)

I've included a TTimer in main form. It shows a message at start and every
interval it changes a label (alternatively 1/2). I can see that it continues
running (changing 1 to 2 and 2 to 1) ever if dll form is shown both in Mac
and Win.

Juan.


2011/8/15 Michael Schnell <mschnell at lumino.de>

> On 08/15/2011 02:21 PM, Juan Sánchez wrote:
>
>> . I've discovered a simple method that seems to run ok on both Win and
>> Mac.
>>
> You don't create the application instance but you initialize it.
>
> Seemingly this does not harm the Application instance of the main
> executable. So it seems like the DLL automatically instantiates it's own
> independent Application instance (and has its own "Application" variable to
> manage same).
>
> This in fact is possible. You might want to verify this by printing both
> the Application pointers via IntToHex(integer(Application))**, 8) ) and
> verify that they are different.
>
> As you don't use a thread, I suppose Application.Initialize in the DLL
> re-attaches the GUI framework to the main thread. I suppose this will freeze
> or destroy the GUI of the main program. This might or might not be
> desirable. I think it is not desirable, as e.g. TTimers are handled via the
> GUI binding.
>
> You might want to check if the GUI and/or the TTimers of the main program
> are still workable wile/after the DLL's GUI is displayed.
>
> -Michael
>
>
>
>
>
> --
> ______________________________**_________________
> Lazarus mailing list
> Lazarus at lists.lazarus.**freepascal.org<Lazarus at lists.lazarus.freepascal.org>
> http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarus<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110815/f7b9ea1a/attachment-0003.html>


More information about the Lazarus mailing list