--- 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

<*> 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