Сообщение от
UR5EQF
Код Ваш не корректный:
Код:
function QRZSearch(Mode: integer; Key1: string; Key2: string; Key3: string;
var Found: PChar; Fmt: integer): Integer; stdcall;
begin
if LibHandle = 0 then
begin
Result := -1;
Exit;
end;
Result := _QRZSearch(Mode, PChar(Key1), PChar(Key2), PChar(Key3), Found, Fmt);
end;
Я бы написал вот так:
Код:
function QRZSearch(Mode, Fmt: Integer; Key1, Key2, Key3: String; var Found: String): Integer;
var
szBuf: array [0...1024] of Char;
begin
Result := -1;
if (LibHandle <> 0) and (@_QRZSearch <> nil) then
begin
Result := _QRZSearch(Mode, PChar(Key1), PChar(Key2), PChar(Key3), @szBuf, Fmt);
Found := szBuf;
end;
end;
И так как библиотека загружается в секции initialization модуля, то смысл в динамической загрузке теряется.
Социальные закладки