library ToolBox; {$mode delphi}{$H+} {$R *.res} uses Classes { you can add units after this } ,uHCDefines ,mainform, uHCGCI, uHCGlobals, uHCTypeDefs ,Windows ,Forms ,ShellAPI ,SysUtils ,Types ,Dialogs, Interfaces, Controls, runtimetypeinfocontrols; const DLLVERN = 11; DLLVERINTN = 5; var frmMain: TfrmMain; {*** Return DLL internal version, i.e. revision 5 of my DLL ***} function DLLVer():word;export;cdecl; begin result := DLLVERN; end; {*** Return DLL interface version, i.e. revision 1 of HCE interface spec ***} function DLLVerInt():word;export;cdecl; begin result := DLLVERINTN; end; {*** Return DLL description, 255 characters max ***} function DLLDesc():PAnsiChar;export;cdecl; begin result := 'HCE Toolbox - export DLL by Don Thomas/Tony Eischens'; end; {*** Free DLL ***} procedure DLLFree();export;cdecl; begin // Do any cleanup here, this is the end frmMain.Free; end; {*** Init DLL ***} procedure DLLInit(hwndHC: HWND; pathHC: PAnsiChar; verHC: PAnsiChar; verSaveGame: LongWord; funcRefs: PHCDLL_FUNC_REF);export;cdecl; begin // here we initialize globals and such for the life of the DLL Application.Initialize; frmMain := TfrmMain.Create(nil); frmMain.ParentWindow := hwndHC; // use inifile to set postion? frmMain.Caption := 'Toolbox V 1.1.4'; frmMain.NewPtr := funcRefs^.funcPtr; //ALE added with GE/DLL code for pointers frmMain.DisposPtr := PHCDLL_FUNC_REF(funcRefs^.next).funcPtr; frmMain.del_HarpoonEvent_list := PHCDLL_FUNC_REF(PHCDLL_FUNC_REF(funcRefs^.next).next).funcPtr; frmMain.Show; end; procedure StartGroup(StartGroup: PHCGroup);export;cdecl; begin frmMain.PStartGroup:=StartGroup; end; procedure ScenLoad(strHarpPath: PAnsiChar; intScenNum: SmallInt; strScenFPath: PAnsiChar; intBSNum: ShortInt; strBSFName: PAnsiChar; intSide: byte);export;cdecl; begin frmMain.strMySide:=format('%d',[intSide]); frmMain.MLtmemLog.Lines.Clear; // ALE clear messagelog output for new scenario end; procedure MsgLog(MsgLine: PAnsiChar);export;cdecl; var intMLC: integer; begin intMLC:=frmMain.SETspnMLC.Value; if (frmMain.MLtmemLog.Lines.Count > intMLC) then frmMain.MLtmemLog.Lines.Delete(intMLC); // end if frmMain.MLtmemLog.Lines.Insert(0, ''); frmMain.MLtmemLog.Lines.Strings[0]:=Format('%s', [MsgLine]); end; exports DLLVer, DLLVerInt, DLLDesc, DLLFree, DLLInit, ScenLoad, MsgLog, StartGroup; // ALE 20130205 Sends updated GroupPtr whenever that changes end.