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.

Last edited by starbucks_mafia; 19/12/03 03:04 PM.

Spelling mistakes, grammatical errors, and stupid comments are intentional.