public new void Dispose()
        {
            addLog("IntermecScanControl Dispose()...");
            _continueWait = false; //signal threads to stop
            SystemEvent waitEvent = new SystemEvent("EndWaitLoop52", false, false);

            waitEvent.PulseEvent();
            System.Threading.Thread.Sleep(100);
            int iTry = 0;

            while (_bWaitLoopRunning && iTry < 5)
            {
                System.Threading.Thread.Sleep(300);
                iTry++;
            }
            addLog("IntermecScanControl Dispose(): ending Threads...");
            //is the waitThread (waitLoop) still running?
            if (waitThread != null)
            {
                addLog("IntermecScanControl Dispose(): ending event watch thread ...");
                waitThread.Abort();
            }
            //is there still a readThread running?
            if (readThread != null)
            {
                addLog("IntermecScanControl Dispose(): ending Barcode reading thread ...");
                readThread.Abort();
            }
            if (bcr != null)
            {
                addLog("IntermecScanControl Dispose(): Calling ScannerOnOff(false)...");
                scannerOnOff(false);
                addLog("IntermecScanControl Dispose(): Disposing BarcodeReader...");
                //bcr.ThreadedRead(false);
                bcr.BarcodeRead -= bcr_BarcodeRead;
                bcr.Dispose();
                bcr = null;
                addLog("IntermecScanControl Dispose(): BarcodeReader disposed");
            }
            try
            {
                addLog("IntermecScanControl Dispose(): enabling HardwareTrigger...");
                //replaced this call as ADCComInterface made problems
                //S9CconfigClass.S9Cconfig.HWTrigger.setHWTrigger(true);
                YetAnotherHelperClass.setHWTrigger(true);
                YetAnotherHelperClass.setNumberOfGoodReadBeeps(1);
            }
            catch (Exception ex)
            {
                addLog("IntermecScanControl Dispose(), Exception: enabling HardwareTrigger: " + ex.Message);
            }
            addLog("IntermecScanControl Dispose(): restoring Scan Button Key...");
            ITCTools.KeyBoard.restoreKey();
            addLog("...IntermecScanControl Dispose(): end.");
            //base.Dispose(); do not use!!
        }
        public IntermecBarcodescanControl3()
        {
            InitializeComponent();
            try
            {
                addLog("IntermecBarcodescanControl2: setHWTrigger(true)...");
                //enable HW trigger, a workaround as HW trigger is sometimes disabled on BarcodeReader.Dispose()
                //if (!S9CconfigClass.S9Cconfig.HWTrigger.setHWTrigger(true))
                //{
                //    addLog("IntermecBarcodescanControl2: setHWTrigger(true)...FAILED. Trying again");
                //    Thread.Sleep(50);
                //    S9CconfigClass.S9Cconfig.HWTrigger.setHWTrigger(true); //try again
                //}
                //replaced above code with the following, there were problems with load/unload the ADCComInterface inside S9CConfig
                YetAnotherHelperClass.setHWTrigger(true);
                //change number of good read beeps to zero
                YetAnotherHelperClass.setNumberOfGoodReadBeeps(0);
                addLog("IntermecBarcodescanControl2: mapKey()...");
                //we need full control of scan start and end
                ITCTools.KeyBoard.mapKey();
            }
            catch (Exception ex)
            {
                addLog("Exception in IntermecBarcodescanControl2: setHWTrigger(true)..." + ex.Message);
            }
            try
            {
                addLog("IntermecBarcodescanControl2: new BarcodeReader()...");
                bcr = new BarcodeReader(this, "default");// ();
                addLog("IntermecBarcodescanControl2: BarcodeReader adding event handlers...");
                bcr.BarcodeRead         += new BarcodeReadEventHandler(bcr_BarcodeRead);
                bcr.BarcodeReadCanceled += new BarcodeReadCancelEventHandler(bcr_BarcodeReadCanceled);
                bcr.BarcodeReadError    += new BarcodeReadErrorEventHandler(bcr_BarcodeReadError);
                addLog("IntermecBarcodescanControl2: starting named event watch thread...");
                waitThread = new System.Threading.Thread(waitLoop);
                waitThread.Start();
                addLog("IntermecBarcodescanControl2: enabling Scanner...");
                bcr.ScannerEnable = true;
                addLog("IntermecBarcodescanControl2: ScannerOn=false...");
                bcr.ScannerOn = false;
            }
            catch (BarcodeReaderException ex)
            {
                bcr = null;
                System.Diagnostics.Debug.WriteLine("BarcodeReaderException in IntermecScanControl(): " + ex.Message);
            }
            catch (Exception ex)
            {
                bcr = null;
                System.Diagnostics.Debug.WriteLine("Exception in IntermecScanControl(): " + ex.Message);
            }
            if (bcr == null)
            {
                addLog("IntermecBarcodescanControl2: BarcodeReader init FAILED");
                throw new System.IO.FileNotFoundException("Intermec.Datacollection.dll or ITCScan.DLL missing");
            }
#if TESTMODE
            //testcodes = new string[8];
            testCodeCount = testcodes.Length;
            testCodePos   = 0;
#endif
        }