CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2009
    Posts
    4

    Event Not Firing, Intermec BarCode Reader

    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:
    Code:
    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!

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Event Not Firing, Intermec BarCode Reader

    It sure looks like you have the event wired up properly. I would look at altering the config settings for the bar code reader. It might be that you have to enable some other property in order for the reader object to fire events. I would also try to connect to different reader events if available.

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Event Not Firing, Intermec BarCode Reader

    Well, it looks like I was close when I said to look for some property that would enable the event.

    You[re missing a method call.

    Code:
    bcr.ThreadedRead( true );
    Download the SDK from the Intermet site - there's tons of example code available.

  4. #4
    Join Date
    Jul 2009
    Posts
    4

    Re: Event Not Firing, Intermec BarCode Reader

    Woops. I actually DO have the bcr.ThreadedRead(true); bit. I have a lot of commented code that I removed when posting this and I left out that one line that's actually there by mistake. I have downloaded the SDK from Intermec, that's where I'm basing my code from. Thanks a lot for the tip though. I can't seem to find any setting under "Intermec Settings" that would deal with telling it to fire events. Looking around online, this same code seems to work for most people. It's quite puzzling.

  5. #5
    Join Date
    Jul 2009
    Posts
    1

    Re: Event Not Firing, Intermec BarCode Reader

    Pheria,

    Did you figure out any solution yet? I have the same exact issue and tried whta you done and for god sake none of the examples in the intermec resource kit work not they have a proper documentaion. It really is frustrating...Please let me know if you did find a solution.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured