![]() |
|
#1
|
|||
|
|||
|
I need to load the DLL's at runtime,
if that makes any difference. Please Help... |
|
#2
|
|||
|
|||
|
// THIS WORKS WITH DELPHI 4.0
// IT MAY WORK WITH OTHERS // PUT THIS IN THE DLL .DPR UNIT exports *showMDIChild; begin DLLProc := @MyDLLProc; // PUT THIS IN A DLL UNIT procedure ShowMDIChild(MainApp : TApplication); export; procedure MyDLLProc(Reason: Integer); var DllApp : TApplication; implementation procedure ShowMDIChild(MainApp : TApplication); export; var *Child : Tform1; begin *if not Assigned(DllApp) then begin * *DllApp := Application; * *Application := MainApp; *end; *Child := Tform1.Create(Application.MainForm); *Child.Show; end; procedure MyDLLProc(Reason: Integer); begin *if Reason = DLL_PROCESS_DETACH then * *{ DLL is unloading. Restore the Application pointer. } * *if Assigned(DllApp) then * * *Application := DllApp; end; // PUT THIS IN THE EXE procedure ShowMDIChild(application : tapplication); external 'd_prj.dll'; procedure TForm1.MDIfromdll1Click(Sender: TObject); begin ShowMDIChild(application); end; ================= It shouldn't make any difference when the dll is loaded just as long as it "is loaded" by the time you call into it. Hope this helps. Craig |
![]() |
| Thread Tools | |
| Display Modes | |
|
|