2013-01-17 1 views
0

저는 C# compact framework 2.0 (windows mobile 6.1)에서 2D 판독기로 Intermec 핸드 헬드 장치 CK30을 개발 중입니다.CK30 : BarcodeReader()를 사용한 후 키보드가 작동을 멈 춥니 다.

바코드를 사용할 때마다 매 키보드가 작동을 멈 춥니 다. 어떤 아이디어?

코드를 수정하십시오. 첫 번째 섹션은 바코드 리더를 구성하는 클래스입니다. 두 번째 섹션은 바코드 판독기를 사용하여 텍스트 상자를 채우는 양식입니다.

바코드 판독기 뭔가를 읽은 후 키보드

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, 나는 이제 별도의 클래스 내에서 BarcodeReader를 사용하고 있는지 relaized ... 작동을 멈 춥니 다. 우리가 조사 할 수 있습니다 (또한 예는 인터멕 Datacollection 리소스 키트와 함께 오는 참조)

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(); 
    } 
} 

이 작동하는 경우 :

은 follwing을, 표준, 예 (한 목록 상자와 형태로 하나의 버튼)을 시도하십시오 왜 구조가 작동하지 않습니다. 최신 DataCollection Resource Kit가 설치되어 있다고 가정합니다.

관련 문제