?
Solved

D3: MDIchild and DLL

Posted on 1998-06-23
3
Medium Priority
?
302 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month9 days, 10 hours left to enroll

762 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