搜一下已答问题可得:<br>-----------------------------------------------------<br> 静态调用:function testfunc;far;external 'c:/run/dll/testdll.dll';<br> 动态调用:temphd:=loadlibrary('c:/run/dll/testdll.dll');<br> getprocess(...);<br> freelibrary(...);<br> <br>-----------------------------------------------------<br>var<br> h : THandle;<br> fn : function(PARAMETER_LIST_HERE) : RETURN_TYPE;<br>begin<br> h := LoadLibraryEx(DLL_FILE_PATH,0,0);<br> if h=0 then<br> begin<br> showMessage('load library error!');<br> exit;<br> end;<br> @fn := GetProcAddress(h,PROC_NAME); //case sensitive<br> if @fn=nil then<br> begin<br> showMessage('get proc address error!');<br> FreeLibrary(h);<br> exit;<br> end;<br> fn(PARAMETER_LIST_HERE); // call proc or function<br> ...<br> FreeLibrary(h);<br>end;<br><br><br><br>