unit uExport;<br><br>interface<br>Uses<br> Windows, Forms, Classes, ADODB;<br><br>Type<br> TrdParam = Record<br> AppMain : TApplication;<br> ADOConn : TADOConnection;<br> sStationID : String;<br> sHosCode : String;<br> sHosName : String;<br> sOpCode : String;<br> sOpName : String;<br> End;<br><br> Procedure InitPlug(prdParam : TrdParam); Export; StdCall; Exports InitPlug;<br><br> Procedure OpenMDIChild(TfrmMDIChild: TComponentClass; var frmMDIChild: TForm);<br><br>Var<br> rdParam : TrdParam;<br> <br>implementation<br>uses<br> Test;<br><br>Procedure OpenMDIChild(TfrmMDIChild: TComponentClass; var frmMDIChild: TForm);<br>var<br> iLoop: integer;<br>begin<br> //-- 1. 查询子窗体是否已经存在<br> for iLoop:=Application.MainForm.MDIChildCount-1 downto 0 do<br> if Application.MainForm.MDIChildren[iLoop]=frmMDIChild then<br> begin<br> frmMDIChild.Show; // 已经存在, 推到前面<br> exit; // 退出<br> end;<br> //-- 2. 不存在则创建<br> Application.CreateForm(TfrmMDIChild, frmMDIChild);<br> frmMDIChild.Show;<br>end;<br><br>Procedure InitPlug(prdParam : TrdParam);<br>Begin<br> rdParam := prdParam;<br> Application := prdParam.AppMain;<br> //<br> OpenMDIChild(TComponentClass(TFrmTest), TForm(FrmTest));//需修改<br>End;<br><br>end.