Dick Grier is right that the serial communications approach is the
best way to go although you may not need to purchase a new scanner.
You should check with the manufacturer of your bar code scanner to see
if they have a "Virtual COM Port" driver for your scanner that you can
use instead of the "keyboard wedge" interface.
Most USB scanners come from the factory configured as a "keyboard" and
when you connect them to the USB port on a PC, Windows loads the built
in Windows USB keyboard driver and the scanner works as a second
keyboard connected to your PC. Metrologic, Handheld Products and most
other scanner manufacturers also have special "Virtual COM Port"
drivers that you can use although you may have to download the special
driver from the manufacturers web site. What you have to do is to
first install the Virtual COM port driver in your PC and then you have
to scan a special bar code in the users manual for the scanner that
will switch it from a keyboard wedge scanner to a "serial" scanner.
This basically reprograms the scanner so that when you connect it to
the USB port on your PC, the new Virtual COM port driver will load
instead of the original keyboard driver.
The driver will create a COM port that will show up in your Windows
Device Manager typically as COM4 or COM5.
You would then use serial communications code in your application to
read in the data from the scanner through the COM port.
On Thu, 13 Mar 2008 10:25:41 +0100, "tim" <tn****@hotmail.comwrote:
>Hi all
I have made a application that scans barcode. The barcode scanner is connect
to the PC via one of the USB ports.
The technique that I use is hidden textbox that constantly has the focus to
process the input on the keydown event. This works fine.
It goes wrong when the user clicks for instance on one of the listboxes.
Before start scanning the user has to click on a button on the toolbar first
to set the focus back on the textbox. In some other cases I can do that in
code.
My customer has problems to click on the button first to start scanning
again. My question is if there is a other method that constantly receives
input from a barcode scanner and process it. If have tried to monitor the
USB port but I can't figure it out how this works. What also interest me is
how other programs do this.
Hopefully someone can help me with suggestions, sample or websites with
information about this topic.
Thanks in advance.
Tim
O yes, I posted this message in two newsgroups because I develop in VB6
and/or .Net so don't' shout at me please.