How to Access Barcode Scanner with VB.Net in Windows CE
I've recently been asked to develop an application for the Motorola MK4000, an all-in-one device with a built-in barcode scanner. It runs Windows CE and supports VB.Net.
I've never written an application for Windows CE, nor using a barcode scanner.
I'm familiar with VB.NET so I'm confident I can figure this out, but I was hoping someone could point me to some resources on how to use t开发者_运维问答he barcode scanner with possibly some example code of how to detect it and read data from it.
Thanks.
With Windows CE, you'll be writing your application in the .NET compact framework. To do this, you'll need to use Visual Studio 2008 Professional (2010 doesn't work with the .NET CF). Since it's .NET, you can use Visual Basic, or C#, whatever you're most comfortable with. And yes, it's very similar to what you're already used to with VB.NET.
I suggest then downloading the appropriate version of the Windows Mobile SDK for your Visual Studio installation. The SDK contains some samples, emulators, and libraries you'll need for developing Windows CE applications in VS 2008.
Next, as Sallow suggested, go to Symbol's site and download the appropriate development kit for your model device. This will contain the libraries necessary for interfacing with the scanner as well as some sample development projects.
In order to debug/emulate, you'll need to download Windows Mobile Device Center. You can then startup emulators in VS2008 (provided you've installed the Windows Mobile SDK), and connect to these emulator instances using the mobile device manager. Here's a guide from Microsoft on how to do this.
Development from then on should be pretty straightforward. Once you're all setup, here's a good getting started link from Microsoft that helped me. For me, I downloaded the Barcode Scanner Pattern Framework from Microsoft and used that code to communicate with the scanner as it was fairly well organized and written.
Since your barcode scanner is built-in to the device, you don't need to worry about interfaces as some have mentioned. You only need to use the appropriate Symbol libraries and subscribe to the scanner Read events. Again, I would suggest the Microsoft barcode scanner pattern factory as a place to start with this... Good luck!
I haven't used the Barcode Scanner in the MK4000 but in general their MK/MC products use the EMDK to access the Barcode-reader. You can download it from http://support.symbol.com and then clicking Software Downloads -> Micro Kiosks -> MK4000. You'll find user manuals and all other useful information
What interface is the barcode scanner using? Is it connected via USB, RS232 or a keyboard wedge? (connection types)
Every thing else depends mostly on this. If the scanner did not come with any kind of interface library RS232 and the ones connected via keyboard wedge are easier to read out with custom code.
If it is connected via USB the vendor should have provided some sort of library. Ideally a .NET one of course. If there is only a C/C++ interface DLL the normal C/C++ to .NET interop techniques apply.
(Using Unmanaged C++ Libraries (DLLs) in .NET Applications @ CodeProject)
(Creating and Calling C Function DLL from .NET @ CodeProject)
(Enable to call C dll in VB.net Code @ StackOverflow)
In either case what you should end up with is an alphanumeric string whenever something is scanned.
Probably not much help based on the information provided but maybe it gets you going.
精彩评论