Solved

D3: MDIchild and DLL

Posted on 1998-06-23
3
293 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to fill array with TArray.Create? 14 94
Delphi Mdi application Child forms get behind control 7 270
creating threads in delphi 1 131
Dev express lookupcombo 3 34
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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

856 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