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 = 6; DLLVERINTN = 4; // SIDES = 3; // SLIVER360 = 134217728; 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 my 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; var ptrTest: Pointer; 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.0.1'; frmMain.Caption := frmMain.Caption; frmMain.NewPtr := funcRefs^.funcPtr; frmMain.DisposPtr := PHCDLL_FUNC_REF(funcRefs^.next).funcPtr; frmMain.del_HarpoonEvent_list := PHCDLL_FUNC_REF(PHCDLL_FUNC_REF(funcRefs^.next).next).funcPtr; //ptrTest := NewPtr(42); 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; end; procedure MsgLog(MsgLine: PAnsiChar);export;cdecl; var intMLC: integer; begin intMLC:=frmMain.SETspnMLC.Value; if (frmMain.MLtmemLog.Lines.Count > intMLC) then begin frmMain.MLtmemLog.Lines.Delete(intMLC); end; frmMain.MLtmemLog.Lines.Insert(0, Format('%s', [MsgLine])); end; exports DLLVer, DLLVerInt, DLLDesc, DLLFree, DLLInit, ScenLoad, MsgLog, StartGroup; // ALE 20130205 Sends updated GroupPtr whenever that changes end.