Home > Back-end >  Delphi DLL dynamic invocation of child form how to determine whether a child form exist
Delphi DLL dynamic invocation of child form how to determine whether a child form exist

Time:09-26

Delphi main form the dynamic invocation DLL a child form, how to determine whether a DLL child form has been in existence (in the main form is open),
If you open then only need to buy before
The dynamic invocation code is as follows:
//DllFormName for a child form of DLL
//ParentForm as the main form
Application:=App;
TheClass:=GetClass (DllFormName);
If (TheClass=nil) then the exit;
Then if TheClass. InheritsFrom (TForm)
The begin
Try
The begin
AForm:=TForm (TheClass. Create). The Create (ParentForm);
AForm. FormStyle:=fsMDIChild;
AForm. Show;
AForm. BringToFront;
The finally
FreeLibrary (ParentForm. Handle);
The end;
The end;

CodePudding user response:

Did you not use aForm to save this form

Judgment, then continue to determine aform to go ah

CodePudding user response:

If not Assigned (MID_1_Frm) then
The begin
MID_1_Frm:=TMID_1_Frm. Create (Self);
MID_1_Frm. WindowState:=MID_WindowState;
End
The else MID_1_Frm. BringToFront;

CodePudding user response:


To be a public variables, assignment, then can judge out,,,,,,,,,,,
  • Related