Page 73 - Advantech WP-5530
P. 73
If (iRet = 0 Or iBytesRtn <> 1) Then
MsgBox("Error opening ADVSYS.sys. Error = " & Err.LastDllError)
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim iBytesRtn As Integer
Dim iRet As Integer, iStatus As Integer
' Get Drawer Status
iRet = DeviceIoControl(DeviceHandle, ADV_STATUS_CTL_CODE, 0, 0, iStatus, 4, iBytesRtn, 0)
If (iRet = 0 Or iBytesRtn <> 1) Then
MsgBox("Error opening ADVSYS.sys. Error = " & Err.LastDllError)
End If
If (iStatus = 0) Then
StatusText.Text = "Cash Drawer(s) Closed"
Else
StatusText.Text = "Cash Drawer(s) Open"
End If
End Sub
66