mobile databases, mobile forms, and mobile synchronization … where you need to work
Providing Pocket Access, Mobile Database, Windows CE Database, and Windows CE Development Solutions

Tip of the Month (June 2009)

Bar Code Scanners

Visual CE has built-in support for barcode scanners from Symbol, Socket, and Intermec. Visual CE also supports barcode scanners from other manufacturers through the use of the manufacturer's Keyboard Wedge (as described below).

Symbol, Socket, and Intermec

For Symbol, Socket, and Intermec bar code readers, there is no need to do anything special in order to enable the bar code scanner. Just (a) create an edit control connected to a text column, and (b) make sure the manufacturer-supplied Keyboard Wedge is OFF (not ON) when the form starts.

When a form is running and focus is set to the control, the barcode reader will be enabled (to trigger a Socket In-Hand Scan Card, click on the edit control). After the barcode is read, focus will be set to the next control in the control order. If that "next control" is a button, Visual CE will automatically press that button, essentially triggering a macro when a barcode is scanned.

Other Barcode Readers

For all other barcode readers, you will need to use the Keyboard Wedge provided by the manufacturer. A Keyboard Wedge is a piece of software that runs in the background, waiting for a barcode to be scanned. When a barcode is scanned, the Keyboard Wedge puts the value into the keyboard buffer (as if the user typed it in on keyboard). The keyboard buffer will then send the characters to whatever happens to have input focus (Pocket Word, a Visual CE form, the Contacts application, etc.).

Keyboard Wedges are usually configurable and allow you to post-pend one or more characters to the value read by the barcode reader (sometimes this is called a post-amble). If you post-pend a <TAB> (or <ENTER>), focus will be sent to the next control in the control order.

If you post-pend a <TAB> (or <ENTER>) followed by a <SPACE>, focus will not only be sent to the next control in the control order, but if that next control is a button, that button will be pressed.

However, some Keyboard Wedges only allow you to post-pend a single character. In that case, just post-pend a <TAB> (or <ENTER>) and set things up so that the Lose Focus event of the edit control fires the macro.


Previous Tips of the Month