[Migrated content. Thread originally posted on 09 May 2011]
Hi All,Can any one advise on how to convert the following code:-
*> start define working storage
Private Shared G_hContext As Integer
Private Shared G_retCode As Integer
Private Shared Protocol As Integer
Private Shared SendBuff(262) As Byte
Private Shared RecvBuff(262) As Byte
Private Shared SendLen As Integer
Private Shared RecvLen As Integer
Private Shared hCard As Integer
Private Shared ioRequest As SCARD_IO_REQUEST
*> end define working storage
*> Start define SCARD_IO_REQUEST
_
Public Structure SCARD_IO_REQUEST
Public dwProtocol As Integer
Public cbPciLength As Integer
End Structure
*> End define SCARD_IO_REQUEST
*> Start VB code section
SendBuff(0) = 128
SendBuff(1) = 20
SendBuff(2) = 0
SendBuff(3) = 0
SendBuff(4) = 6
SendLen = 5
RecvLen = 14
G_retCode = ModWinsCard.SCardTransmit(hCard, _ *> this calls "Start DLL read"
ioRequest, _
SendBuff(0), _
SendLen, _
ioRequest, _
RecvBuff(0), _
RecvLen)
tmpStr = ""
For indx = 0 To 5
tmpStr = tmpStr & String.Format("{0:X2}", (RecvBuff(indx)))
Next indx
p_string = tmpStr *>p_string ends up with serial number of card in reader
*> end VB code section
*> Start DLL read
Public Declare Function SCardTransmit Lib "Winscard.dll" (ByVal hCard As Integer, _
ByRef pioSendRequest As SCARD_IO_REQUEST, _
ByRef SendBuff As Byte, _
ByVal SendBuffLen As Integer, _
ByRef pioRecvRequest As SCARD_IO_REQUEST, _
ByRef RecvBuff As Byte, _
ByRef RecvBuffLen As Integer) As Integer
*> end DLL read