串口通讯的问题?在线等!在线等!在线等!在线等!在线等!在线等!在线等!在线等!在线等!在线等!在线等!急!急!急!急!急!急!急!急!急!急!急!急! ( 积

  • 主题发起人 主题发起人 bjluoagzn
  • 开始时间 开始时间
B

bjluoagzn

Unregistered / Unconfirmed
GUEST, unregistred user!
串口通讯的问题?在线等!在线等!在线等!在线等!在线等!在线等!在线等!在线等!在线等!在线等!在线等!急!急!急!急!急!急!急!急!急!急!急!急! ( 积分: 100 )<br />Dll中申明函数原型:
C语言申明
int WINAPI rfReader_M1_read(long ReaderHandle,unsigned short icdev, unsigned char KeyA_B, unsigned char block, unsigned char * key, unsigned char *pData);
VB调用如下:
Dim TF As Long '返回标志
Dim bySourByte(256) As Byte
Dim szDestString(256) As Byte
Dim strbuf As String * 256
Dim strbuf1 As String * 256
strbuf1 =&quot;FFFFFFFFFFFF&quot;
Call StringToByte(strbuf1, 12, szDestString(0))
TF = rfReader_M1_read(RHandle, 0, 0, 4, szDestString(0), bySourByte(0))

我在Delphi申明如下:
function rfReader_M1_read(ReaderHandle:LongInt;icdev:Word;KeyA_B:Byte;block:Byte;key,pSnr:pchar):Integer;stdcall;external 'MifareOne.dll';
怎么样把它翻译成Delphi语言,谢谢!
 
Dll中申明函数原型:
C语言申明
int WINAPI rfReader_M1_read(long ReaderHandle,unsigned short icdev, unsigned char KeyA_B, unsigned char block, unsigned char * key, unsigned char *pData);
VB调用如下:
Dim TF As Long '返回标志
Dim bySourByte(256) As Byte
Dim szDestString(256) As Byte
Dim strbuf As String * 256
Dim strbuf1 As String * 256
strbuf1 =&quot;FFFFFFFFFFFF&quot;
Call StringToByte(strbuf1, 12, szDestString(0))
TF = rfReader_M1_read(RHandle, 0, 0, 4, szDestString(0), bySourByte(0))

我在Delphi申明如下:
function rfReader_M1_read(ReaderHandle:LongInt;icdev:Word;KeyA_B:Byte;block:Byte;key,pSnr:pchar):Integer;stdcall;external 'MifareOne.dll';
怎么样把它翻译成Delphi语言,谢谢!
 
function rfReader_M1_read(ReaderHandle:LongInt;icdev:Word;KeyA_B:Byte;block:Byte;var key:byte var pSnr:byte):Integer;stdcall;external 'MifareOne.dll';

var
TF : LongInt;
bySourByte : array[0..255] of byte;
szDestString: array[0..255] of byte;
begin
TF := rfReader_M1_read(RHandle, 0, 0, 4, szDestString[0], bySourByte[0])
end;
 
strbuf1 =&quot;FFFFFFFFFFFF&quot;
Call StringToByte(strbuf1, 12, szDestString(0))

这段语句没有翻译呀?
 
pSnr:pchar

是pSnr:pchar,bySourByte[0])是Byte类型呀?
 
strbuf1 := 'FFFFFFFFFFFF';
StringToByte (strbuf1, 12, szDestString[0]);

char 和 Byte是一样的内存
 
9494,金卡绣球jk8.com讲啦,俺就不多嘴了
 
后退
顶部