改写一条语句50分!(50分)

N

nywjx

Unregistered / Unconfirmed
GUEST, unregistred user!
以下是VB6里声明引用dll的语句,请哪位帮我翻译成delphi的语句,在线等待,测试<br>成功立马送分,决不食言。<br>Declare Function FIUAcquireDevice Lib "fiu32.dll" <br>&nbsp; (dwHandle As Long, ByVal dwPortType As Long, ByVal dwPortAddress As Long, ByVal lpbEncryptionkey As String) As Long
 
Function FIUAcquireDevice(dwHandle :float, dwPortType :float, dwPortAddress :float,lpbEncryptionkey :float):float;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;stdcall external fiu32.dll'
 
Function FIUAcquireDevice(dwHandle, dwPortType, dwPortAddress: LongInt; lpbEncryptionkey: String): Longint; Stdcall; External 'fiu32.dll';
 
Declare Function FIUAcquireDevice Lib "fiu32.dll" <br>&nbsp; (dwHandle As Long, ByVal dwPortType As Long, ByVal dwPortAddress As Long, ByVal lpbEncryptionkey As String) As Long<br>function(dwHandle ,dwPortType,dwPortAddress &nbsp;:long;lpbEncryptionkey :string):long;<br>&nbsp;Stdcall; External 'fiu32.dll';
 
Function FIUAcquireDevice(dwHandle:longint;var dwPortType, dwPortAddress: LongInt;<br>var lpbEncryptionkey: String): Longint; Stdcall; External 'fiu32.dll';
 
to :mlzhou,编译的时候提示:float是未定义的变量。<br>to:goodfox2002,<br>dwHandle,dwPortType:LongInt;<br>lpbEncryptionkey:string;<br>Com1 = 0;<br>AcquireRetVal:=FIUAcquireDevice(dwHandle,dwPortType,Com1,lpbEncryptionkey);<br>返回值AcquireRetVal为65539,查找厂家提供的资料发现是:<br>An invalid pointer was passed to the API.<br>我该怎么办?
 
小黄鱼:<br>编译的时候提示:long是未定义的变量
 
to :cxx1997<br>我的代码见上面。<br>照你的写法,编译提示:Types of actual and formal var parameters must be identical.<br>光标停在AcquireRetVal:=FIUAcquireDevice(dwHandle,dwPortType,Com1,lpbEncryptionkey);<br>这条语句中的“Com1,”后面
 
Function FIUAcquireDevice(dwHandle, dwPortType, dwPortAddress: DWORD; lpbEncryptionkey: String): Longint; Stdcall; External 'fiu32.dll';
 
Function FIUAcquireDevice(dwHandle ,dwPortType ,dwPortAddress :float,lpbEncryptionkey :string):float;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;stdcall external fiu32.dll'
 
to:goodfox2002,<br>还是老问题,返回值为65539。<br>dwHandle,dwPortType:LongInt;<br>lpbEncryptionkey:string;<br>Com1 = 0;<br>AcquireRetVal:=FIUAcquireDevice(dwHandle,dwPortType,Com1,lpbEncryptionkey);<br>返回值AcquireRetVal为65539,查找厂家提供的资料发现是:<br>An invalid pointer was passed to the API.<br>快帮帮我吧,我另外加分。
 
to :mlzhou,编译还是不通过,提示:float是未定义的变量。<br>
 
<br>dwHandle,dwPortType:DWOED; &lt;=====<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =====<br>lpbEncryptionkey:string;<br>Com1 = 0;<br>你试试
 
to :goodfox2002<br>还是不行,返回值还是65539
 
把float换成其它的试一下。double,DWORD,Longint,long word........
 
com1的类型?
 
vb里面string对应于PChar<br>Function FIUAcquireDevice(dwHandle:LongInt, dwPortType:LongInt, dwPortAddress:LongInt, lpbEncryptionkey:pChar):LongInt;stdcall;external 'fiu32.dll';<br>注:<br>lpbEncryptionkey如果你原来是string,那么要转换成PChar<br>
 
to goodfox2002:com1是常数,值为0;<br>to Pipi:还是同样的错误。
 
是不是函数本身的事情。编译时出的错吗?
 
to mlzhou:<br>不是出错,下面是程序<br>AcquireRetVal:=FIUAcquireDevice(dwHandle,dwPortType,Com1,lpbEncryptionkey);<br>返回值AcquireRetVal为65539,查找厂家提供的资料发现是:<br>An invalid pointer was passed to the API.<br>
 
顶部