Mam w Dll-u taką oto funkcje
function Info(x: integer): string;
begin
if x=1 then info:='AAAAA';
if x=2 then info:='BBBBB';
end;
kiedy wywołuje ją za pomocą tej procedury to co prawda dostaje tekst AAAAA albo BBBB ale przy okazji
dostaje też komunikat pod tytułem Access violetion bleble Program1.exe on read adress blebleble:
procedure TForm1.Button1Click(Sender: TObject);
var
DLL : THandle;
Info : function(x: integer):string;
s: string;
begin
DLL := LoadLibrary('test.dll');
try
@info := GetProcAddress(DLL, 'Info');
s:=Info(1);
finally
FreeLibrary(DLL);
end;
end;
Ma ktoś pomysł co z tym zrobić??
Z góry dzięki