Solved

D3: MDIchild and DLL

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now