2 Replies Latest reply on Nov 21, 2017 1:16 AM by a23d6022-3fdf-4d61-8891-9448c1ad0e5a

    OnScan notifier not being called

    a23d6022-3fdf-4d61-8891-9448c1ad0e5a

      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