mIRC Homepage
Posted By: Aeron Keeping a DLL Loaded in Delphi code - 18/12/03 03:14 PM
I read the mIRC about this but it's writin in C++ i think i like to know what the delphi's code for this is:

i got this but it crashes mIRC:
Code:
procedure LoadDll(mHwnd: HWND; mVersion: DWORD; mKeep:boolean); stdcall;
begin
end;


Edit: whoops wrong forum sorry!
Almost right, but the info is actually provided in the form of a pointer to a structure of type TLoadInfo.

Code:
type
  TLoadInfo = packed record
    mVersion: Cardinal;
    mHwnd: hWnd;
    mKeep: Boolean;
  end;
  PLoadInfo = ^TLoadInfo;

Code:
procedure LoadDll(Info: PLoadInfo); stdcall;
begin
  //Info.mKeep := False; // Uncomment me to stop DLL staying loaded
end;

Code:
function UnloadDll(mTimeOut: Integer): Integer; stdcall;
begin
  Result := 1;
end;

Plus of course you need to list both commands in your exports clause.
Posted By: Aeron Re: Keeping a DLL Loaded in Delphi code - 19/12/03 04:20 PM
Thx!
© mIRC Discussion Forums