Solved

MDI application with childwins in dll's

Posted on 1998-10-07
10
211 Views
Last Modified: 2010-04-06
Hi!

I'm having a problem with an MDI application. The child windows are defined in a .dll or .bpl and I can't make it
work. In the .dll I have a function that shows the window and set's the application.handle property for the .dll to
the MDI-applications handle. When creating the window I get the following message:
    Project raised exception class EInvalidOperation with message 'Cannot create form. No MDI forms are
currently active'

Is it possible to do this? If it is, any ideas?
/Per
0
Comment
Question by:peed112097
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 10

Expert Comment

by:Jacco
ID: 1342109
A bit more down the list Westy asks the same question!

Just a remark :)

I am looking into the problem.

Regards Jacco
0
 

Author Comment

by:peed112097
ID: 1342110
I've solved the problem when using a dll,but look into my other Q if you have any idea's there! I'll be deleting this Q soon!

/Per
0
 
LVL 10

Expert Comment

by:Jacco
ID: 1342111
What was the solution?
0
 

Author Comment

by:peed112097
ID: 1342112
Look at westys Q!
0
 
LVL 10

Expert Comment

by:Jacco
ID: 1342113
I can't get your solution to work. Are you sure the MDI child form is not compiled into the main EXE? I get a resource error because the application handle is wrong.

Regards Jacco
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:peed112097
ID: 1342114
Ok, if you send me your e-mail address I'll mail the project to you. I'm sure that the child's not in the .exe.

0
 
LVL 10

Expert Comment

by:Jacco
ID: 1342115
Jacco@HotelConcepts.COM

Thanks in advance!

Regards Jacco
0
 
LVL 2

Accepted Solution

by:
Hagen040798 earned 200 total points
ID: 1342116
Hi peed

The answer for the problem is the same answer for your question with the dynamicly loading packages and includeds Objects.
I have for my Firma yust this programmed.
TForms in Librarys-DLL's and the Loading, Creation, Destroying and unloading from the Librarys at Runtime.
Post me your E-Mail-Address and i send your a Example from my Project.
my E-Mail is HaReddmann@AOL.COM

Hagen.

0
 
LVL 2

Expert Comment

by:Thaddy
ID: 1342117
You might be interest in this little snippet.
Design your form, add action:=caFree to the formclose event!
and compile it in this dll framework. You call the dll form from your main app like so: ShowMDIChildForm(Application);

library MDIForms;
uses
  SysUtils, Classes,Forms,Windows,ChildU in 'ChildU.pas' {ChildForm};
var
  DLLApp : TApplication;
procedure MyDLLProc(Reason: Integer);
begin
  if Reason = DLL_PROCESS_DETACH then
    if Assigned(DllApp) then
      Application := DllApp;
end;
procedure ShowMDIChildForm(MainApp : TApplication);
var
  Child : TChildForm;
begin
  if not Assigned(DllApp) then begin
    DllApp := Application;
    Application := MainApp;
  end;
  Child :=TChildForm.Create(Application.MainForm);
  Child.Show;
end;
exports
  ShowMDIChildForm;
begin
  DllApp := nil;
  DLLProc := @MyDLLProc;
end.
0
 
LVL 2

Expert Comment

by:Hagen040798
ID: 1342118
Hi Per.

Have You reseived me Mail ?

Hagen.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi 10 Seattle Dataset Actions 5 79
Thread safe  opinion 7 126
Intraweb download file link ? 1 110
how to change, disabled button color FMX ? 1 18
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…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

864 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

24 Experts available now in Live!

Get 1:1 Help Now