VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   4590
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7875
   LinkTopic       =   "Form1"
   ScaleHeight     =   4590
   ScaleWidth      =   7875
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton TestBtn 
      Caption         =   "Test"
      Height          =   375
      Left            =   3000
      TabIndex        =   1
      Top             =   4080
      Width           =   1575
   End
   Begin VB.ListBox List1 
      Height          =   3765
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   7575
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' ==========================================================================
' Get manufacture and main volume info
' (1) A card has two main info, the first is ATR, and the other is main volume
' (2) ATR is generated automatically when file is created. In general, manufact
'     will write its info into ATR. The max. length of ATR is 15 bytes, and such
'     info can be read by DIC_OPEN.
' (3) The main volume of a card is 16 bytes, and such volume works as a driver name
' (4) DIC_Get will read the ATR or VOLUME info into its buffer, and the return of 
'     Dic_Get is the length of buffer.
' (5) Run GET_CARD_INFO with DIC_Command before DIC_Get.
' ==========================================================================' ==========================================================================
' Get manufacture and main volume info
' (1) A card has two main info, the first is ATR, and the other is main volume
' (2) ATR is generated automatically when file is created. In general, manufact
'     will write its info into ATR. The max. length of ATR is 15 bytes, and such
'     info can be read by DIC_OPEN.
' (3) The main volume of a card is 16 bytes, and such volume works as a driver name
' (4) DIC_Get will read the ATR or VOLUME info into its buffer, and the return of 
'     Dic_Get is the length of buffer.
' (5) Run GET_CARD_INFO with DIC_Command before DIC_Get.
' ==========================================================================

Private Sub TestBtn_Click()
Dim errcode, num, hic, i As Long
Dim cmddata(0 To 255) As Byte ' command buffer
Dim buffer(0 To 255) As Byte ' user buffer
Dim curline As Integer

curline = 0

num = DIC_Find()
For i = 0 To num - 1
    hic = DIC_Open(i, 0&)
    If (hic >= 0) Then
        Exit For
    End If
Next i
If (i = num) Then
    Exit Sub
End If

errcode = DIC_Command(hic, GET_CARD_INFO, cmddata(0))
errcode = DIC_Get(cmddata(0), ATR, BY_ARRAY, buffer(0)) ' abstract ATR from cmddata to buffer
List1.List(curline) = "manufacture info: " + StrConv(buffer, vbUnicode)

curline = curline + 1
errcode = DIC_Get(cmddata(0), VOLUME, BY_ARRAY, buffer(0)) ' abstract main Volume from cmddata to buffer
List1.List(curline) = "main volume: " + StrConv(buffer, vbUnicode)
curline = curline + 1

errcode = DIC_Close(hic)
End Sub

