OnScan notifier not being called

G Gurmi Chera 2 years 11 months ago
7 2 0

Hi Folks,
 
What I am trying to do
 
I am porting an old VS 2008 application from Psion TekLogic to Zebra symbol (handheld mc9200). The app is a winforms .Net application written in C#.
 
I have hit an issue where despite attaching a notifier to a form it is not being called, the notifier is being attached in a templatescanner class that is inherited by further classes. This code replaces existing code so I know the call mechanism etc is valid.
 
The code is as follows
 
In the attach notifier code (template class)
 
// Declarations
 
 
Barcode2.OnScanHandler myScanNotifyHandler = null;
 
 
 
// Inside the constructor
 
                    this.myScanNotifyHandler = new Barcode2.OnScanHandler(OnScan);
 
                    m_scanner.OnScan += new Barcode2.OnScanHandler(this.myScanNotifyHandler);
 
// further on in the template class
 
protected virtual void OnScan(ScanDataCollection sd) { }
 
In the child class(es)
 
 
protected override void OnScan(ScanDataCollection sd) {
// blah blah
}
 
Whats happening is that the text box that is given focus on the form receives the barcode I am trying to scan but the OnScan is not called (where I want to to do some pre-processing)
 
What I have tried
 
I have used the sample apps CS_Barcode2Sample1 and even CS_BarcodeSample1.VS2008 and basically copied everything they are doing to the letter but I am still getting the issue. A search of this forum and good old google shows nothing useful. I am completely stuck as to what the issue is,
 
Can anyone help?
 
Thanks in advance for any and all help

Please register or login to post a reply

2 Replies

V Vedsatx Saddvv

If you are getting the scan data in the textbox,  it sounds like DataWedge is enabled.  DataWedge is an app that comes on the device and is intended to be used by apps that do not use the Scan APIs, they just expect the scan data to be entered into a text field.  If you disable DataWedge on the device,  you should have better luck.

G Gurmi Chera

Hi Daniel,

Thanks for your reply. I eventually got around the problem by moving the code from Template to each individual child class and that did the job (granted it's not a very elegant solution) without having to disable datawedge.

CONTACT
Can’t find what you’re looking for?