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 managment code
' (1) managment code help developers to manage ROCKEY. Users cannot change it.
'	a) Zone Code, ROCKEY is sold in which area
'	b) Agent Code, sold via which agent
'	c) User1 code, sold to which user
'	d) User1 code, sold to which user
' (2) Use DIC_Get to get the info
' ==========================================================================

Private Sub TestBtn_Click()
Dim errcode, num, hic, i As Long
Dim cmddata(0 To 255) As Byte ' Command buffer
Dim curline As Integer
Dim cZone, cAgent, cUser1, cUser2 As Long

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_MANAGER_CODE, cmddata(0))
cZone = DIC_Get(cmddata(0), ZONE, BY_VALUE, 0&)
cAgent = DIC_Get(cmddata(0), AGENT, BY_VALUE, 0&)
cUser1 = DIC_Get(cmddata(0), USER1, BY_VALUE, 0&)
cUser2 = DIC_Get(cmddata(0), USER2, BY_VALUE, 0&)
List1.List(curline) = "Zone code: " + Hex(cZone)
curline = curline + 1
List1.List(curline) = "Agent code: " + Hex(cAgent)
curline = curline + 1
List1.List(curline) = "User1: " + Hex(cUser1)
curline = curline + 1
List1.List(curline) = "User2: " + Hex(cUser2)
curline = curline + 1

errcode = DIC_Close(hic)
End Sub

