You might want to look at this article:

http://delphi.about.com/library/weekly/aa020805a.htm

which presents a workable solution to the MDI form in dll problem.


George


On 10 Jun 2005 at 23:37, Katja Bergman wrote:

To:                     [email protected]
From:                   "Katja Bergman" <[EMAIL PROTECTED]>
Date sent:              Fri, 10 Jun 2005 23:37:04 -0000
Subject:                [delphi-en] Re: MDIForm in DLL
Send reply to:          [email protected]

> --- In [email protected], Josef Jatinugroho <[EMAIL PROTECTED]> 
> wrote:
> > Hai everyone...
> > 
> > Can anyone tell me what's the problem when MDI Child
> > forms don't show up at MDI form's Children list when
> > they are added from DLL?
> 
> Okay, let me try to explain the Delphi problem with DLL's. Every Delphi 
> application that uses the Forms unit will contain a global variable 
> called Application of type TApplication. This component is a wrapper 
> around an invisible window (size 0x0 pixels, cannot be resized) and 
> this window is responsible for responding to any Windows messages that 
> are sent to your application.
> Now, when you create a form in a DLL, this DLL will also have a global 
> Application variable but this one will NOT respond to any Windows 
> messages. Yet all the forms and other VCL stuff in your application 
> might be referring to this Application variable instead of the one in 
> your main executable. Basically, your MDI form is trying to communicate 
> with the wrong Application object.
> 
> There's a similar problem with the Screen variable of type TScreen and 
> several other variables that have been defined as glocal variables by 
> Borland. So now you know one of the risks of using global variables in 
> your application.
> 
> And sorry but I don't know how to get a DLL-MDI-form to work correctly 
> in your application. You could try to use runtime packages instead. But 
> in my experience it's just better to not put MDI forms in your DLL's. 
> Or find some plug-in possibilities for Delphi.
> 
> One option could be to let your main executable hold an empty MDI form 
> and your DLL would contain a TFrame instead of a TForm. When calling 
> this frame, you just create the new (empty) MDI form and put the frame 
> inside this form. That might work...
> 
> With kind regards,
> X Katja Bergman.
> 
> 
> 
> 
> -----------------------------------------------------
> Home page: http://groups.yahoo.com/group/delphi-en/
> To unsubscribe: [EMAIL PROTECTED] 
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
> -- 
> GeodenTech : No Incoming Virus Detected
> Checked by AVG Anti-Virus.
> Version: 7.0.323 / Virus Database: 267.6.6 - Release Date: 06/08/2005
> 


***************************************************************
You can enter a weekly drawing to win a dozen roses free at:
   www.flowerniche.com/index.html#winroses
***************************************************************
Visit Our WebSite at 
www.geodentech.com
*********************************************************
This email and files transmitted may contain privileged information.

Any unauthorized disclosure, use or dissemination, either whole or partial, is 
prohibited.

If you receive this message in error please return it to the sender and delete 
all 
copies.

Thank you




-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to