请问高手(100分)

  • 主题发起人 主题发起人 loner_meme
  • 开始时间 开始时间
L

loner_meme

Unregistered / Unconfirmed
GUEST, unregistred user!
我想问一下大侠们:<br>这是我定义的一个函数,<br>function A(ServerName : PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MsgName &nbsp; &nbsp;: PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FromName &nbsp; : PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Buf &nbsp; &nbsp; &nbsp; &nbsp;: PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var BufLen : Integer) : Integer; cdecl; &nbsp; <br>可它编译时出现错误:<br>Unsatisfied forward or external declaration: 'A'
 
如果是自己写的函数,请在implementation部分写函数的实现.<br>如果是从Dll中连接,请<br>我想问一下大侠们:<br>这是我定义的一个函数,<br>function A(ServerName : PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MsgName &nbsp; &nbsp;: PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FromName &nbsp; : PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Buf &nbsp; &nbsp; &nbsp; &nbsp;: PWideChar;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var BufLen : Integer) : Integer; cdecl; &nbsp; external 'dllname.dll';
 
把A改了,改成别的试试
 
LeeChange说得对,你的A函数没有写完整。请继续...
 
同意LeeChange的,如果自己写函数,不能放在Form类中,必须在implementation中实现<br>你的错误是因为将函数声明放在Form类中了
 
在implementation部分写函数体时用以下声明:<br>function [red]tform[/red].a(....);<br>begin<br>...<br>end;
 
接受答案了.
 
后退
顶部