Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
284 | f9daq | 1 | VERSION 5.00 |
2 | Begin VB.Form Dialog |
||
3 | BorderStyle = 3 'Fixed Dialog |
||
4 | Caption = "Select Your Choice" |
||
5 | ClientHeight = 3240 |
||
6 | ClientLeft = 4935 |
||
7 | ClientTop = 6015 |
||
8 | ClientWidth = 7410 |
||
9 | LinkTopic = "Form1" |
||
10 | MaxButton = 0 'False |
||
11 | MinButton = 0 'False |
||
12 | ScaleHeight = 3240 |
||
13 | ScaleWidth = 7410 |
||
14 | ShowInTaskbar = 0 'False |
||
15 | Begin VB.ListBox List1 |
||
16 | Height = 2985 |
||
17 | Left = 120 |
||
18 | TabIndex = 2 |
||
19 | Top = 120 |
||
20 | Width = 5775 |
||
21 | End |
||
22 | Begin VB.CommandButton CancelButton |
||
23 | Caption = "Cancel" |
||
24 | Height = 375 |
||
25 | Left = 6120 |
||
26 | TabIndex = 1 |
||
27 | Top = 600 |
||
28 | Width = 1215 |
||
29 | End |
||
30 | Begin VB.CommandButton OKButton |
||
31 | Caption = "OK" |
||
32 | Default = -1 'True |
||
33 | Height = 375 |
||
34 | Left = 6120 |
||
35 | TabIndex = 0 |
||
36 | Top = 120 |
||
37 | Width = 1215 |
||
38 | End |
||
39 | End |
||
40 | Attribute VB_Name = "Dialog" |
||
41 | Attribute VB_GlobalNameSpace = False |
||
42 | Attribute VB_Creatable = False |
||
43 | Attribute VB_PredeclaredId = True |
||
44 | Attribute VB_Exposed = False |
||
45 | |||
46 | Option Explicit |
||
47 | |||
48 | Dim versions As String |
||
49 | Dim serials As String |
||
50 | |||
51 | Private Sub CancelButton_Click() |
||
52 | Unload Me |
||
53 | |||
54 | End Sub |
||
55 | |||
56 | Private Sub Form_Load() |
||
57 | versions = String$(1000, 0) |
||
58 | serials = String$(1000, 0) |
||
59 | Err = USMCInit(nod, versions, 1000, serials, 1000) |
||
60 | If nod = 0 Or Err Then |
||
61 | MsgBox "No Devices Found" & (Chr(13)) _ |
||
62 | & "Or DLL is locked - try restart Visual Basic", vbOKOnly, "ERROR" |
||
63 | Unload Me |
||
64 | Else |
||
65 | PrintDevices serials, versions |
||
66 | List1.ListIndex = 0 |
||
67 | End If |
||
68 | |||
69 | End Sub |
||
70 | |||
71 | Private Sub List1_DblClick() |
||
72 | OKButton_Click |
||
73 | End Sub |
||
74 | |||
75 | Private Sub OKButton_Click() |
||
76 | Dev = List1.ListIndex |
||
77 | serial = Mid(serials, Dev * 17 + 1, 16) |
||
78 | version = Mid(versions, Dev * 5 + 1, 4) |
||
79 | Load DLGForm |
||
80 | Unload Me |
||
81 | End Sub |
||
82 | |||
83 | Sub PrintDevices(serials As String, versions As String) |
||
84 | Dim out As String |
||
85 | Dim i As Long |
||
86 | For i = 0 To nod - 1 |
||
87 | out = "Device - " & (i + 1) & " Serial Number - " & Mid(serials, i * 17 + 1, 16) & _ |
||
88 | " Version - " & Mid(versions, i * 5 + 1, 4) |
||
89 | List1.AddItem out, i |
||
90 | Next |
||
91 | End Sub |
||
92 |