Blame | Last modification | View Log | RSS feed
VERSION 5.00
Begin VB.Form Dialog
BorderStyle = 3 'Fixed Dialog
Caption = "Select Your Choice"
ClientHeight = 3240
ClientLeft = 4935
ClientTop = 6015
ClientWidth = 7410
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3240
ScaleWidth = 7410
ShowInTaskbar = 0 'False
Begin VB.ListBox List1
Height = 2985
Left = 120
TabIndex = 2
Top = 120
Width = 5775
End
Begin VB.CommandButton CancelButton
Caption = "Cancel"
Height = 375
Left = 6120
TabIndex = 1
Top = 600
Width = 1215
End
Begin VB.CommandButton OKButton
Caption = "OK"
Default = -1 'True
Height = 375
Left = 6120
TabIndex = 0
Top = 120
Width = 1215
End
End
Attribute VB_Name = "Dialog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim versions As String
Dim serials As String
Private Sub CancelButton_Click()
Unload Me
End Sub
Private Sub Form_Load()
versions = String$(1000, 0)
serials = String$(1000, 0)
Err = USMCInit(nod, versions, 1000, serials, 1000)
If nod = 0 Or Err Then
MsgBox "No Devices Found" & (Chr(13)) _
& "Or DLL is locked - try restart Visual Basic", vbOKOnly, "ERROR"
Unload Me
Else
PrintDevices serials, versions
List1.ListIndex = 0
End If
End Sub
Private Sub List1_DblClick()
OKButton_Click
End Sub
Private Sub OKButton_Click()
Dev = List1.ListIndex
serial = Mid(serials, Dev * 17 + 1, 16)
version = Mid(versions, Dev * 5 + 1, 4)
Load DLGForm
Unload Me
End Sub
Sub PrintDevices(serials As String, versions As String)
Dim out As String
Dim i As Long
For i = 0 To nod - 1
out = "Device - " & (i + 1) & " Serial Number - " & Mid(serials, i * 17 + 1, 16) & _
" Version - " & Mid(versions, i * 5 + 1, 4)
List1.AddItem out, i
Next
End Sub