как ни пытался встроить вашу конструкцию, делфи все время ругается на синтаксис, а в силу неопытности не могу понять, что ему не нравится, и где тогда это все должно быть. Попробовал сделать так - не помогло:
Connect_Net: function (IPAdd:WideString; Port:Integer): ShortInt; cdecl;
Меня еще сильно напрягает, что даже процедура без параметров не поддается!
[Definition]
Disconnect(void)
[Usage]
Disconnect from the device and release related resources.
[Parameter]
None
[Return Value]
None
Код:
procedure TForm1.Button1Click(Sender: TObject);
var W1:WideString;
B1:TBSTR;
L1:Longint;
dHandle:THandle;
Disconnect: procedure (); stdcall; //cdecl тоже не помог
begin
@Disconnect:=nil;
dHandle:=LoadLibrary('zkemkeeper.dll');
if dHandle<>0 then
begin
ShowMessage('DLL Load');
@Disconnect:=GetProcAddress(dHandle, 'Disconnect');
if @Disconnect<>nil then ShowMessage('Happy');
FreeLibrary(dHandle);
end
else
ShowMessage('Load DLL Fail!');
end;
То есть даже указатель на процедуру не получается.