我的调用源代码如下:
for i:=0 to 1000 do
begin
if SysUtils.FindFirst(ExtractFilePath(Application.ExeName)+strPlugIn+'*.dll', faAnyFile, SR) = 0 then
begin
repeat
DLLName:= PChar(ExtractFilePath(Application.ExeName)+strPlugIn+sr.Name);
DLLHandle:= LoadLibrary(DLLname);
try
@GetMenuInfo:= GetProcAddress(DLLHandle,'MenuInfo');
finally
FreeLibrary(DLLHandle);
end;
until SysUtils.FindNext(SR) <> 0;
SysUtils.FindClose(SR);
end;
end;
freelibray应该没错吧!!
不知你有没有这样调用呢!例子:
var
libhandle:Thandle
begin
libhandle:=loadlibrary(pchar('aa.dll'));
@shownumber:=getprocaddress(libhandle,'shownumber')
end;
然后再释放!!!