unit HogeUnit;
interface
uses
Windows, Messages, SysUtils, Forms,StdCtrls, contnrs, ComCtrls,....
type
...
var
...
HogeDLLHdl : THandle;
...
implementation
var
...
GetStyleMsgMsg:function: PChar;stdcall;
GetHoge:procedure(Wnd : HWND):stdcall;
SetHoge:function():stdcall;
procedure GetHoge(Wnd : HWND); stdcall; external 'hoge.dll' name 'GetHoge';
function SetHoge():HWND; stdcall; external 'hoge.dll' name 'SetHoge';
...
procedure DLLLoader();
begin;
...
HogeDLLHdl := LoadLibrary(PChar(AppPath + 'Hidetabdll.DLL'));
if (HogeDLLHdl < HINSTANCE_ERROR) then begin;
OutErrMsg('Hoge.DLLがありません。終了します');
end else begin
@GetHoge := GetProcAddress(HogeDLLHdl, 'GetHoge');
@SetHoge := GetProcAddress(HogeDLLHdl, 'SetHoge');
end;
...
end;
...
procedure DLLUnLoader();
begin;
FreeLibrary(HidetabDLL);
end;
end.
|