8
82625741
Unregistered / Unconfirmed
GUEST, unregistred user!
我在系統中動態調用DLL中MDI窗體,如果主窗體只調用一個DLL的話就不會有地址錯誤,但如果你同時調用多個DLL的MDI窗體就會出現地址錯誤,並且不知是什么地址出錯,無法單調,請各位做過的朋友提示一下,都有哪些情況會出現這種錯誤!謝謝<br>動態庫調用方式如下<br>procedure ProdDllShow(PApplication: TApplication; PForm: TForm;FormName:String;FHandle:Hwnd;PCn:TSocketConnection;PUm:TUserMessage); export; stdcall;<br>begin<br> Application:=PApplication;<br> FormName := UpperCase(FormName);<br> FormHandle := FHandle;<br> Cn := PCn;<br> Um := PUm;<br> if not Assigned(Data) then<br> Data := TData.Create(nil);<br> if FormName='FRMPR_PRODMOSUBSEARCH' then<br> begin<br> if not Assigned(frmPR_ProdMOSubSearch) then<br> frmPR_ProdMOSubSearch := TfrmPR_ProdMOSubSearch.Create(PForm);<br> frmPR_ProdMOSubSearch.Show;<br> end;<br>end;<br>procedure DLLUnloadProc(Reason: Integer); register;<br>begin<br> if Reason = DLL_PROCESS_DETACH then<br> begin<br> if Assigned(frmPR_ProdMOSubSearch) then<br> frmPR_ProdMOSubSearch.Free;<br> Data.free;<br> Application := SaveApplication;<br> end;<br>end;<br>exports<br> ProdDllShow;<br>begin<br> SaveApplication := Application;<br> DllName := 'ProdDll';<br> DLLProc := @DLLUnloadProc;<br>end.