Solved

Barcode Scanner string conversion

Posted on 2010-11-10
4
720 Views
Last Modified: 2013-12-27
We are developing an application that needs a barcode reader (any make and model) to read SUPPLIERS barcodes, and then look up a corresponding COMPANY STOCK CODE in a lookup table and input this into the running application as a string - i.e. as if the barcode read was the looked-up string.

THis will involve

1. intercepting the barcode read
2. processing it,
3. injecting the result into the keyboard buffer.

2 and 3 are easy, but 1 isn't.  Is there anything out there to do this?

I can't believe this is the first question on this, but I cannot find any previous posts: but it is difficult to search for....

0
Comment
Question by:jonathonberg
4 Comments
 
LVL 3

Expert Comment

by:roynaufal
ID: 34102911
Hello,

I am not totally sure I understand what you mean, so can you please explain and give a bit more details on step 1 ?
0
 
LVL 1

Expert Comment

by:Sindread
ID: 34102913
This should be very simple.
When you scan with the barcode reader it will input the barcode as if it were text to the pc.
for example if you had notepad open it would display the code.

For the processing aspect would be dependant on how you want to program this in whatever language.
you could do a simple vb app. where you focus on text box scan with barcodereader which would push the value into the textbox and have corresponding event for when a value is entered to look up company ccode in DB or flat file table.
0
 
LVL 2

Author Comment

by:jonathonberg
ID: 34103050
Ok - I need to provide more detail:  The application we are scanning into is Sage 50 accounts.  We are scanning in barcodes on items to make up an invoice on trade counters.  This program is "closed" and will not allow modification.  

We need to read the supplier barcode, use a utility to convert this code into a valid stock code using a lookup table and enter that stock code as if it had been keyed.  So if the barcode was "123" we might want to trasnlate this to "XYZ" input into the Sage 50 application.

We are happy and competant to write a memory-resident .Net utuility to perofrm the lookup and to push the final result into the keyboard buffer - my question is how do we intercept the barcode read and stop it going into the keyboard buffer?

P.S. The customer wants a USB or keyboard wedge scanner gun plugge dinto a PC, not a terminal or ODA (we know we could do it that way)

Thank you.
0
 
LVL 25

Accepted Solution

by:
kode99 earned 500 total points
ID: 34118396
Many barcode scanners can be programmed to do some formatting on the data scanned.  This usually includes things like adding a prefix and suffix to the scan.  You would need to check the manual for any scanner you want to use for the details.

With this you just need to intercept keystrokes to Sage.  You do nothing until the prefix character shows up then you trap and buffer the characters until the suffix shows up.  Then do your lookup and inject the keystrokes for your translated code into Sage.  The keystrokes from the scanner are coming fast so as long as your lookup is fast it will be seamless to the user.

By the sound of it you probably have the skills available for hooking events but if not here's a easy way to get it done,

http://www.codeproject.com/KB/winsdk/messagespy.aspx

Reference on hooking in .net,

http://msdn.microsoft.com/en-us/magazine/cc188966.aspx

0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now