S
shhw
Unregistered / Unconfirmed
GUEST, unregistred user!
dll 主程序<br>function FrmReport(Ahand:THandle; adoconn:TADOConnection;AUnitNamechar):Boolean;stdcall;//<br>begin<br> Result := false;<br> try<br> Application.Handle := Ahand ;<br> showFrm_Report(adoconn, AUnitName);<br> except<br> exit;<br> end;<br> Result := true;<br>end;<br><br>exports<br>FrmReport;<br>----------------------------------------<br>调用程序<br> TReport=function (Ahand:THandle; adoconn:TADOConnection;AUnitNamechar):Boolean;stdcall;<br><br>var lhnd:THandle;<br> pp:TReport;<br>begin<br> try<br> lhnd:=LoadLibrary('ReportDll.dll'); {装载DLL}<br> if lhnd = 0 then<br> begin<br> Application.MessageBox(Pchar('调用Dll失败'),'提示',MB_ICONINFORMATION+MB_SYSTEMMODAL);<br> exit;<br> end<br> else<br> begin<br> pp:=GetProcAddress(lhnd,'FrmReport');<br> if pp(Application.Handle,ADOQuery1.Connection,pchar('西科测控')) then exit;<br> end;<br> finally<br> freelibrary(lhnd);<br> end;<br>请大侠们给指导一下