F
fxh7622
Unregistered / Unconfirmed
GUEST, unregistred user!
下面是我调用动态连接库的代码,为什么 GetprocAddress的返回值总是NIL呢???<br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls, Mask, ComCtrls, ToolWin, Menus, RzTreeVw, RzListVw,<br> ExtCtrls, KindFormCaption, KindMenu, ImageStatus, ImgList, IEButton,<br> dcOutBar, dcOutPanel;<br>Type TDllStr=Function :String;<br><br><br>type<br> TFormMain = class(TForm)<br> MainMenu: TMainMenu;<br> ToolBar1: TToolBar;<br>......<br>.....<br>var<br> Main:TMenuItem;<br> Found:Integer;<br> sr:TSearchRec;<br> Handle:THandle;<br> DirFile,DllFile:String;<br> Proc:TFarproc;<br>......<br><br><br> <br>DllFile:=Dir+'/'+sr.Name;<br> Handle:=LoadLibrary(Pchar(DllFile));<br> if Handle<HINSTANCE_ERROR then<br> begin<br> Application.MessageBox('加载动态库失败','失败',MB_OK);<br> end<br> else<br> begin<br> Proc:=GetprocAddress(Handle,'Getinfo');<br> ......<br><br><br>