关于在DELPHI中调用DLL的问题 ( 积分: 0 )

  • 主题发起人 主题发起人 hw198347
  • 开始时间 开始时间
H

hw198347

Unregistered / Unconfirmed
GUEST, unregistred user!
type &nbsp; tfnSendMessage =function(hWnd :HWND):String;stdcall;<br> Th :=LoadLibrary('DLLTEST.dll');<br> &nbsp; &nbsp; &nbsp; &nbsp; if Th&gt;0 &nbsp; &nbsp; &nbsp; &nbsp; then<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Tp :=GetProcAddress(Th,PChar('fnSendMessage'));<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if tp &lt;&gt;nil &nbsp;then<br>我怎么得到的TP是空的,每次执行到最后一行就跳过去的
 
type &nbsp; tfnSendMessage =function(hWnd :HWND):String;stdcall;<br> Th :=LoadLibrary('DLLTEST.dll');<br> &nbsp; &nbsp; &nbsp; &nbsp; if Th&gt;0 &nbsp; &nbsp; &nbsp; &nbsp; then<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Tp :=GetProcAddress(Th,PChar('fnSendMessage'));<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if tp &lt;&gt;nil &nbsp;then<br>我怎么得到的TP是空的,每次执行到最后一行就跳过去的
 
怎么没高人近来指教??
 
注意函数大小写必须与dll中的一致
 
========type &nbsp; tfnSendMessage =function(hWnd :HWND):String;stdcall;<br>======================<br>dll 注意事项,如动态调用过程或函数后面不要加StdCall,否则就要加StdCall;
 
后退
顶部