Question

I am using the Symbol/Motorola Scanner SDK with an LS3578 Scanner connected in IBM HID through USB. The scanner works as intended on this program and several others that I have written. My problem is that people need to leave this particular application open (so they don't have to login all the time) and after approximately five minutes the program will lose the EventHandler to capture the Barcode Scans.

I have made a work-around by allowing the scanner to be setup again (subscribe to the EventHandler) after 5 minutes but its not something I really want to release into production.

I have tried timers to perform the setup automatically and everything else I can think of to get this to at least appear as though it is staying connected and all events are intact. Any suggestions for counting the events linked to BarcodeEvent or just keeping the event from being lost would be greatly appreciated.

Thanks!

Was it helpful?

Solution

Answering this myself as I found the error and it was all mine. I was declaring the CCoreScanner (the scanner object) in a separate class which, I assume, was causing the scanner object to be Garbage Collected between 3.5 and 5 minutes after the program was opened. I moved the scanner object and associated code into the code-behind for the form and this seems to have solved the problem.

Good luck to anyone else experiencing this issue; hope my mistakes/lack-of-knowledge can help you save some time with your debugging.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top