ASKER
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
hDcd = New DecodeHandle(DecodeDeviceCap.Exists Or DecodeDeviceCap.Barcode)
Catch ex As Exception
MessageBox.Show("Uitzondering opgetreden bij het laden van de Barcode scanner App Elf2RentFactory!", "Decorder error")
End Try
Dim reqType As DecodeRequest = CType(1, DecodeRequest) Or DecodeRequest.PostRecurring
reqID = hDcd.PostRequestMsg(reqType, wndMsg, System.Convert.ToUInt32(Constants.WM_SCANNED))
end sub
Public Sub SetDcdText(ByVal msgReqID As Integer)
Dim cID As CodeId = CodeId.NoData
Dim dcdData As String = String.Empty
Try
dcdData = Strings.Replace(hDcd.ReadString(msgReqID, cID), vbCr, "")
Catch ex As Exception
MessageBox.Show("Fout bij lezen Barcode")
Exit Sub
End Try
Me.txtCodeId.Text = cID.ToString()
myVerwerkScan(dcdData) 'this is the function called to do something with the scanned barcode
End Sub
Public Sub New()
MyBase.New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
wndMsg = New WndMessageWindow(Me)
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If Not (hDcd Is Nothing) Then
hDcd.CancelRequest(reqID)
End If
MyBase.Dispose(disposing)
End Sub
Private Sub bttnScan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttnScan.Click
'manually activate barcode scan
hDcd.SoftTrigger(DecodeInputType.Barcode, 5000)
End Sub
Private Sub txtDcdData_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtDcdData.Validating
myVerwerkScan(Me.txtDcdData.Text)
End Sub
ASKER
Protected Overrides Sub WndProc(ByRef msg As Message)
Select Case msg.Msg
Case Constants.WM_SCANNED
Me.dlgParent.SetDcdText(msg.LParam.ToInt32())
End Select
End Sub
Public Sub SetDcdText(ByVal msgReqID As Integer)
Dim cID As CodeId = CodeId.NoData
Dim dcdData As String = String.Empty
Try
dcdData = Strings.Replace(hDcd.ReadString(msgReqID, cID), vbCr, "")
Catch ex As Exception
MessageBox.Show("Fout bij lezen Barcode")
Exit Sub
End Try
Me.txtCodeId.Text = cID.ToString()
myVerwerkScan(dcdData)
End Sub
ASKER
Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,
TRUSTED BY