Код:
var
Handle:THandle;
LoadMind: function(P:PChar): Integer; stdcall;
GetReplyTo: function(const InText: PChar; OutText: PChar; Len: integer): PChar; stdcall;
Len,i:Integer;
Rep:PChar;
begin
Len:=255;
GetMem(Rep,255);
Handle := LoadLibrary('smartbot.dll');
if Handle <> 0 then try
LoadMind := GetProcAddress(Handle, 'LoadMind');
GetReplyTo := GetProcAddress(Handle, 'GetReplyTo');
if Assigned(LoadMind) then Caption:=IntToStr(LoadMind('mind.dat'));
except
end;
if Assigned(GetReplyTo) then begin
GetReplyTo(PChar(Edit1.Text),Rep,Len);
Edit2.Text:=copy(Rep,1,Len);
end else Edit2.Text:='no reply';
FreeMem(Rep);
if Handle<>0 then FreeLibrary(Handle);