A
asphunter
Unregistered / Unconfirmed
GUEST, unregistred user!
指针定义:<br>type<br> NodePtr=^TNodePtr;<br> TNodePtr=record<br> curDir: NodePtr;<br> next: NodePtr;<br>end;<br><br>外部函数定义:<br>Type Tmymethod=procedure(filenamechar;var myDir: NodePtr);<br><br>调用过程如下:<br>var<br> aptr:TFarproc;<br> lhnd:Thandle;<br> mymethod:Tmymethod;<br> m:NodePtr;<br>begin<br> lhnd:=null;<br> lhnd:=LoadLibrary('C:/Demo.DLL');<br><br> if (lhnd<32) then<br> begin<br> showmessage('The Demo.DLL load Error.');<br> exit;<br> end;<br><br> aptr:=GetprocAddress(lhnd,'mymethod');<br><br> if aptr<>nil then<br> begin<br> new(m);<br> mymethod:=Tmymethod(aptr);<br> mymethod('c:/a.txt',m);//执行到此时出错,说地址访问错误,我用VC++调时是正确的<br> end;<br><br> FreeLibrary(lhnd);<br>end;