Dear friends,
I wrap an unmanaged VC++ 6.0 class in
VB .NET like below :
=============================
Code:
Declare Function ACR120_ReadATQB Lib "ACR120U.DLL" (ByVal rHandle As Short, ByRef pATQB As Byte) As Short
Declare Function PICC_RATS Lib "ACR120U.DLL" (ByVal rHandle As Short, ByVal FSDI As Byte, ByRef atslen As Byte, ByRef ats As Byte) As Short
======================================
but when i start coding , i encounter the following difficulties, please kindly help :
Code:
1.
i change pResponseData in C++ becoming pResponseData(0), is this true ?
C++
..
if (ACR120_ReadATQB(rHandle, pResponseData)==0) {
ResponseDataLength=7;
// if (ACR120_DirectSend(rHandle, 2, pData, &ResponseDataLength, pResponseData, TimeOut)==0) {
CardFrameSize=pResponseData[10]>>4;
}
..
VB
..
If ACR120U.ACR120_ReadATQB(G_rHandle, pResponseData(0)) = 0 Then
ResponseDataLength = 7
CardFrameSize = pResponseData(10) >> 4
End If
..
2.
i change pResponseData in C++ becoming pResponseData(0), and &ResponseDataLength (C++) becoming ResponseDataLength(VB), is this true ?
and how to write pResponseData[1]&0x0f; in VB .NET ??
C++
..
if (PICC_RATS(rHandle, 4, &ResponseDataLength, pResponseData)>=0) {
CardFrameSize=pResponseData[1]&0x0f;
}
..
VB
..
If ACR120U.PICC_RATS(G_rHandle, 4, ResponseDataLength, pResponseData(0)) >= 0 Then
CardFrameSize = pResponseData(1) & 0x0f
End If
..
3.
And how to write the following statements in VB .NET correctly, i try but they are not right...
C++
...
for (i=0; i<ResponseDataLength; i++) {
StrMsg.Format(" %02X", pResponseData[i]);
strcat(pdata,StrMsg);
}
StrMsg.Format("%s = %s", ATS_ATQB, pdata);
LstIndx=m_List.AddString(StrMsg);
...
my VB .NET code which triggers error :
..
For i = 0 To ResponseDataLength - 1
pData = pData + pResponseData(i).ToString() + "02X"
Next
ListBox1.Items.Add(ATS_ATQB.ToString + " = " + pData)
..
...
Thank you,
hendy