在过程中的调用: procedure TForm1.proctest var findfrm:TFarProc; thehandle:Thandle; i:integer; type Tshowfrm=function(int icdev,unsigned char _Mode,unsigned long *_Snr); begin try thehandle:=LoadLibrary(pchar(Path+'\文件名.dll')); if thehandle=0 then begin messagebox(0,'找不到对应的动态链接库,程序不能运行!','警告!',MB_ICONWARNING); end else begin findfrm:=GetprocAddress(thehandle,rf_card); i:=Tshowfrm(findfrm)(ServerName); end; finally FreeLibrary(thehandle); end; end;
procedure TForm1.proctest
var findfrm:TFarProc;
thehandle:Thandle;
i:integer;
type
Tshowfrm=function(int icdev,unsigned char _Mode,unsigned long *_Snr);
begin
try
thehandle:=LoadLibrary(pchar(Path+'\文件名.dll'));
if thehandle=0 then
begin
messagebox(0,'找不到对应的动态链接库,程序不能运行!','警告!',MB_ICONWARNING); end
else
begin
findfrm:=GetprocAddress(thehandle,rf_card);
i:=Tshowfrm(findfrm)(ServerName);
end;
finally
FreeLibrary(thehandle);
end;
end;