Pheria
July 6th, 2009, 12:19 PM
Greetings,
I'm having some difficulty with an Intermec handheld that uses an integrated barcode scanner. The program is supposed to fire an event when a barcode is successfully read. For some reason I can't figure out, the event isn't firing. I know that the program can interface with the barcode scanner using the BarcodeReader object I have, because if I tell the object to turn on the scanner, the scanner on the device will turn on, etc. I also know that the handheld IS actually reading barcodes because the green check mark LED on the device lights up when a barcode is read.
Here's what the code looks like:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Intermec.DataCollection;
namespace NA
{
public partial class Receipt : Form
{
private Intermec.DataCollection.BarcodeReader bcr;
public Receipt()
{
InitializeComponent();
try
{
//bcr = new BarcodeReader("default");
bcr = new BarcodeReader();
bcr.BarcodeRead +=new BarcodeReadEventHandler(bcr_BarcodeRead);
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
}
void bcr_BarcodeRead(object sender, BarcodeReadEventArgs bre)
{
MessageBox.Show("Event triggered");
this.listBox1.Items.Add(bre.strDataBuffer.ToString());
this.listBox1.Items.Add("SymbologyID = " + bre.SymbologyDetail.ToString());
}
}
}
I've also tried manually enabling the reading of certain code types, and enabling the scanner altogether manually. It doesn't appear to make any difference, and it's all enabled by default.
Any assistance would be appreciated.
Thanks!
I'm having some difficulty with an Intermec handheld that uses an integrated barcode scanner. The program is supposed to fire an event when a barcode is successfully read. For some reason I can't figure out, the event isn't firing. I know that the program can interface with the barcode scanner using the BarcodeReader object I have, because if I tell the object to turn on the scanner, the scanner on the device will turn on, etc. I also know that the handheld IS actually reading barcodes because the green check mark LED on the device lights up when a barcode is read.
Here's what the code looks like:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Intermec.DataCollection;
namespace NA
{
public partial class Receipt : Form
{
private Intermec.DataCollection.BarcodeReader bcr;
public Receipt()
{
InitializeComponent();
try
{
//bcr = new BarcodeReader("default");
bcr = new BarcodeReader();
bcr.BarcodeRead +=new BarcodeReadEventHandler(bcr_BarcodeRead);
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
}
void bcr_BarcodeRead(object sender, BarcodeReadEventArgs bre)
{
MessageBox.Show("Event triggered");
this.listBox1.Items.Add(bre.strDataBuffer.ToString());
this.listBox1.Items.Add("SymbologyID = " + bre.SymbologyDetail.ToString());
}
}
}
I've also tried manually enabling the reading of certain code types, and enabling the scanner altogether manually. It doesn't appear to make any difference, and it's all enabled by default.
Any assistance would be appreciated.
Thanks!