Blame | Last modification | View Log | RSS feed
VERSION 5.00Begin VB.Form DialogBorderStyle = 3 'Fixed DialogCaption = "Select Your Choice"ClientHeight = 3240ClientLeft = 4935ClientTop = 6015ClientWidth = 7410LinkTopic = "Form1"MaxButton = 0 'FalseMinButton = 0 'FalseScaleHeight = 3240ScaleWidth = 7410ShowInTaskbar = 0 'FalseBegin VB.ListBox List1Height = 2985Left = 120TabIndex = 2Top = 120Width = 5775EndBegin VB.CommandButton CancelButtonCaption = "Cancel"Height = 375Left = 6120TabIndex = 1Top = 600Width = 1215EndBegin VB.CommandButton OKButtonCaption = "OK"Default = -1 'TrueHeight = 375Left = 6120TabIndex = 0Top = 120Width = 1215EndEndAttribute VB_Name = "Dialog"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseOption ExplicitDim versions As StringDim serials As StringPrivate Sub CancelButton_Click()Unload MeEnd SubPrivate Sub Form_Load()versions = String$(1000, 0)serials = String$(1000, 0)Err = USMCInit(nod, versions, 1000, serials, 1000)If nod = 0 Or Err ThenMsgBox "No Devices Found" & (Chr(13)) _& "Or DLL is locked - try restart Visual Basic", vbOKOnly, "ERROR"Unload MeElsePrintDevices serials, versionsList1.ListIndex = 0End IfEnd SubPrivate Sub List1_DblClick()OKButton_ClickEnd SubPrivate Sub OKButton_Click()Dev = List1.ListIndexserial = Mid(serials, Dev * 17 + 1, 16)version = Mid(versions, Dev * 5 + 1, 4)Load DLGFormUnload MeEnd SubSub PrintDevices(serials As String, versions As String)Dim out As StringDim i As LongFor i = 0 To nod - 1out = "Device - " & (i + 1) & " Serial Number - " & Mid(serials, i * 17 + 1, 16) & _" Version - " & Mid(versions, i * 5 + 1, 4)List1.AddItem out, iNextEnd Sub