D5, Windows XP SP2.
Hi, this is my source code:
procedure TForm1.Button1Click(Sender : TObject);
var
HINST : longint;
FarPointer : TFarProc;
proc : procFuncRunReport;
lastError : dword;
MesStr : string;
tempInt: longbool;
begin
try
HINST := LoadLibrary(pchar(FdllFilename));
except
HINST := -1;
end;
if HINSt <> -1 then
begin
FarPointer := GetProcAddress(HINST, 'myTestDLLProcedure');
if FarPointer <> nil then
try
......
finally
FreeLibrary(HINST);
end
else
begin
.......
end;
When I first click the button, it loads the DLL and pop up the form (this
form within the DLL), it is loaded sucessfully.
Then when I click the button again, I got a exception about the "
The instruction at "0x00000000" referenced memory at "0x00000000". The
memory could not be "read".
Any hints.