下面的代码一个是静态加载DLL,一个是动态加载DLL,静态的时候一起正常,但是动态的时候程序就有些问题了,程序也不报错,但是就是运行不成功,没有达到代码的效果,帮我看看是哪错了呢?[静态代码]
procedure InstallDll(path:string;MainFormHandle,ExplorerProcessID:THandle);stdcall;external 'install.dll';
...
var h:THandle;
   h:=FindProcessName;//FindProcessName是自己写的一个函数,没有问题
   if h<>0 then
     InstallDll(extractfilepath(paramstr(0)),self.Handle,h);
[动态代码]
Type TProc1=procedure(path:string;MainFormHandle,ExplorerProcessID:THandle);stdcall;
Var Proc1: Tproc1;
MyHandle,h:THandle;
begin
MyHandle:=LoadLibrary ('install.dll') ;
If MyHandle<= 0 then
Raise Exception.Create
( '动态链接库调用失败,错误代码是:'+Inttostr(Getlasterror))
else
@Proc1:=GetProcAddress(MyHandle,'InstallDll');
if not Assigned(Proc1) then
Raise Exception.Create('GetProcAddress调用失败,错误代码是:'+inttostr(getlasterror))
else
begin
   h:=FindProcessName;
   showmessage(IntToStr(h));
   //if h<>0 then
     Proc1(extractfilepath(paramstr(0)),self.Handle,h);
 end;
Freelibrary(Myhandle); // 卸载DLL
end;