How to integrate the scan barcode option on my WinCE application?

倾然丶 夕夏残阳落幕 提交于 2019-12-11 04:09:12

问题


I'm new to the CE environment, I'm creating an application for a mobile computer with a barcode scanne that uses Windows CE 5.0 (Motorola mc3000).

I'm using VS 2008 and I'm programming with C#.

I made a litte demo project that it runs successfully on the device. My application have a scan task so it need to use the Barcode reader: Access to the scan hardware, make it run, read the returned result and display it into a textBox!

The problem is that I don't know how to integrate the scan part into my application.

Any help on this?


回答1:


Well, first step would be to look in the documentation for the Motorola MC3000. I don't know if there is one for the MC3000 but I know that in the Motorola EMDK for .Net they provide quite a few sample C# VS2008 projects and a couple of them are for barcode reading.




回答2:


Kobunite has posted you the first step. So go to the download page of the Motorola EMDK an watch the examples. After that you have to reference the Symbol.dll and Symbol.Barcode.dll in your project (local copy = true). Then you can begin to write your "barcode-class" with an event-handler for the scan-event. When a barcode is scanned via the hardware-trigger the event will throw an then you can place the barcode-string in your focused textbox or do something else with it (e.g. filtering in a datagrid). Hope this helps.




回答3:


Just to simply scan a barcode there is a much easier solution.

By default the barcode scanner should also output into the keyboard cache.

To test it simply open a text editor and scan a barcode. If the barcode appears then you are good. You can simply use a normal textbox and make sure focus is on it.

The problem is however that you need a terminator. The easiest solution is to append the Carriage return symbol to any scanned value. Most handheld devices have a utility somewhere where you can append characters to scan. Appending '\r' (without quotes) works for most devices.

This means that you don't have to do a single thing extra on your code. Just make sure the textbox support keyboard input and starts processing when enter is pressed.

Motorola uses the utility called DataWedge. Here is a link to it's manual (PDF file). Look at page 5 for carriage return and line feed. DataWedge Manual (old but should still help)

The main advantage is that it allows the user to also use manual input in case the barcode is damaged. The disadvantage is that you lose the barcode metadata (i.e. barcode encoding type, etc.) But this is not required 99% of the time anyway.



来源:https://stackoverflow.com/questions/15027493/how-to-integrate-the-scan-barcode-option-on-my-wince-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!