Solved

D3: MDIchild and DLL

Posted on 1998-06-23
3
294 Views
Last Modified: 2010-04-04
I've read some time ago, that MDI within DLLs only work if you are messing around with the forms.pas and so on, and they said with d3 this problem will be solved. but now i am in need of writing such an application, and it
won't run. the mdichild in the .DLL cant find the MDIForm (same error in D2).
Now, is there a possibility without changing forms.pas ?
0
Comment
Question by:cydo
3 Comments
 
LVL 5

Expert Comment

by:ronit051397
ID: 1355447
Can you be more specific in what you want to write?
0
 
LVL 4

Accepted Solution

by:
d003303 earned 200 total points
ID: 1355448
Yo,
your DLL has to have an exported function like
function CreateMDIChild(AOwner : TComponent);
that creates your form class.
From the EXE, create the MDI child with
CreateMDIChild(Application);
It is important to pass the EXEs Application variable over to the DLL.

Slash/d003303
0
 

Author Comment

by:cydo
ID: 1355449
After trying and trying, i found another solution -
in the dll you have to write

application.handle:=MainHandle;

(whereas MainHandle is the handle
of the main application given to the Dll with an exported function)
then I can create the form inside the DLL with

DLLForm:= TDLLForm.CreateParented(MainMDIFormHandle);

whereas MainMDIFormHandle is the handle of the main MDIForm.

The problem was:

I have a main application which has one MDIform and several MDIChilds.
Now i want to write a DLL which holds another MDIchilds which should
be added to the main MDIForm. As in D2 this wasnt possible (while creating
the form inside the DLL the program could not find the main MDIForm - and refused to
create the mdichild) without changing the forms.pas

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi : could not find program, '...exe' 2 212
Help on project with Soap 10 61
Firemonkey webbrowser scrollbars ? 1 57
TlistView is Really heavy on Android 3 11
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question