2013-01-17 59 views
0

我正在开发Intermec手持设备CK30,并在C#compact framework 2.0(windows mobile 6.1)中使用2D阅读器。CK30:使用BarcodeReader()后,我的键盘停止工作

每次我使用条形码mey键盘停止工作。任何想法为什么?

继承人的代码。第一部分是配置条形码阅读器的类。第二部分是使用条形码阅读器填充文本框的表单。

阅读与条形码阅读器的东西后,键盘停止工作......

using System; 
using System.Collections.Generic; 
using System.Text; 
using System.Windows.Forms; 

using Intermec.DataCollection; 

namespace BarCodeReaderTest 
{ 
    class LeitorCodigoDeBarras 
    { 
     public BarcodeReader LerCodigoDeBarras() 
     { 
      try 
      { 
       BarcodeReader meuLeitor = new BarcodeReader("default", 4096); 
       meuLeitor.ScannerEnable = true; 
       meuLeitor.ThreadedRead(true); 

       return meuLeitor; 
      } 
      catch (BarcodeReaderException bx) 
      { 
       MessageBox.Show("Não foi possível inicializar o leitor de código de  barras. Contate seu supervisor. \n" + bx.Message); 

       return null; 
      } 
     } 
    } 
} 


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 BarCodeReaderTest 
{ 
    public partial class Form1 : Form 
    { 



     public BarcodeReader leitor; 

     public Form1() 
     { 

      InitializeComponent(); 

      LeitorCodigoDeBarras classeLeitor = new LeitorCodigoDeBarras(); 

      leitor = classeLeitor.LerCodigoDeBarras(); 
      leitor.BarcodeRead += new  BarcodeReadEventHandler(this.eventoLeitorCodigoDeBarras); 

     } 


     void eventoLeitorCodigoDeBarras(object sender, BarcodeReadEventArgs e) 
     { 
      tbCodLido.Text = e.strDataBuffer; 
     } 
    }   
} 
+0

我从来没有听说过这样的问题,它没有逻辑意义。这真的是你测试和重现问题的代码吗? – josef

+0

是的,这是,先生。 – Andrew

+0

使用最新的固件重新刷新设备,或者先尝试恢复出厂默认设置。 这不是正常的行为。 – josef

回答

1

OK,我现在relaized你是一个单独的类中使用BarcodeReader。

请尝试follwing,标准,例如(一个列表框,并形成一个按钮):

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 BarcodeReader 
{ 
    public partial class Form1 : Form 
    { 
     private Intermec.DataCollection.BarcodeReader bcr; 
     public Form1() 
     { 
      InitializeComponent(); 
      bcr = new Intermec.DataCollection.BarcodeReader(); 
      bcr.BarcodeRead += new BarcodeReadEventHandler(bcr_BarcodeRead); 
      bcr.ThreadedRead(true); 
     } 
     void bcr_BarcodeRead(object sender, BarcodeReadEventArgs bre) 
     { 
      this.listBox1.Items.Add(bre.strDataBuffer); 
     } 
    } 
    private void btnExit_Click(object sender, EventArgs e) 
    { 
     if (bcr !=null) 
     { 
      bcr.Dispose(); 
     } 
     Application.Exit(); 
    } 
} 

如果这样的作品(见实例与Intermec的数据收集资源工具包来了),我们可以检查,为什么你构建不起作用。我假设你安装了最新的DataCollection资源工具包。