Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

D3: MDIchild and DLL

Posted on 1998-06-23
3
Medium Priority
?
306 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 600 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

810 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