Integrating a Scanner with Visual Basic 
Author Message
 Integrating a Scanner with Visual Basic

Hi, I'm currently working on a software application to handle customers.  We
are planning to create customer cards with barcode on them to be able to
process them faster when they come in...  I have to do some research on what
products I can use and how easily would I be able to integrate it into the
program..  I guess what I would like to happen is that when a card is passed
under the scanner, it would recognize the barcode and decode it, then pull
up the customer's info...

Can some suggests some links to resource that describes how I can accomplish
this?
Thanks
John



Wed, 18 Jun 1902 08:00:00 GMT  
 Integrating a Scanner with Visual Basic
If all you want is an ID system then a simple bar code reader should
be fine. Either a solidly mounted unit that a card with label printed
with a bar code or a pen that can trace over the bar code would be
fine. In either case, my experience is simply with a unit that puts
the characters read into the keyboard buffer. It looks like you are
just entering the values from the keyboard. Simple and efficient.

Dan

On Thu, 3 Aug 2000 11:58:45 -0700, "John Sun"

Quote:

>Hi, I'm currently working on a software application to handle customers.  We
>are planning to create customer cards with barcode on them to be able to
>process them faster when they come in...  I have to do some research on what
>products I can use and how easily would I be able to integrate it into the
>program..  I guess what I would like to happen is that when a card is passed
>under the scanner, it would recognize the barcode and decode it, then pull
>up the customer's info...

>Can some suggests some links to resource that describes how I can accomplish
>this?
>Thanks
>John



Wed, 18 Jun 1902 08:00:00 GMT  
 Integrating a Scanner with Visual Basic

Quote:
> Hi, I'm currently working on a software application to handle customers.
We
> are planning to create customer cards with barcode on them to be able to
> process them faster when they come in...  I have to do some research on
what
> products I can use and how easily would I be able to integrate it into the
> program..  I guess what I would like to happen is that when a card is
passed
> under the scanner, it would recognize the barcode and decode it, then pull
> up the customer's info...

> Can some suggests some links to resource that describes how I can
accomplish
> this?
> Thanks
> John

Easy stuff. Most scanner come with a keyboard wedge so that the scanner can
be placed (plugged in) between the computer and keyboard "cord/wire". So the
barcode stuff is entered into your computer as if it was typed in at the
keyboard...

You can also buy software to print out the barcodes, or you could easily
scan the internet for code details and write it into your software directly

Here's something below I did years ago in C++ (just was hacking around) it
took about an hour and a half for me to find stuff about Code 3of9 and
program this thing to print barcodes to my screen. It isn't much help if you
don't understand C++, and there isn't a lot of comments but  szSsku is a
string passed into the function, then that gets translated character by
character into Os and 1s (szBinBc). And finally whether it's a 1 or a 0
determines the thickness of the line.

Hope this helps... the web is full of this stuff.

void CCode39View::OnDraw(CDC* pDC)
{
 CCode39Doc* pDoc = GetDocument();
 ASSERT_VALID(pDoc);

 // TODO: add draw code for native data here
 szSsku.TrimLeft();
 szSsku.TrimRight();
 szSsku.MakeUpper();
 if (! szSsku.IsEmpty())
 {
  if (szSsku.GetAt(0)!='*')
   szSsku = "*" + szSsku;
  if (szSsku.GetAt(szSsku.GetLength()-1)!='*')
   szSsku += "*";
  pDC->TextOut(0,0,szSsku);
  CString  szBinBc("");
  for (int nChr = 0; nChr < szSsku.GetLength(); nChr++)
  {
   if (szSsku.GetAt(nChr) == '0')
    szBinBc += "0001101000"; // note :: all binary data has an extra narrow
space after it
   if (szSsku.GetAt(nChr) == '1')
    szBinBc += "1001000010";
   if (szSsku.GetAt(nChr) == '2')
    szBinBc += "0011000010";
   if (szSsku.GetAt(nChr) == '3')
    szBinBc += "1011000000";
   if (szSsku.GetAt(nChr) == '4')
    szBinBc += "0001100010";
   if (szSsku.GetAt(nChr) == '5')
    szBinBc += "1001100000";
   if (szSsku.GetAt(nChr) == '6')
    szBinBc += "0011100000";
   if (szSsku.GetAt(nChr) == '7')
    szBinBc += "0001001010";
   if (szSsku.GetAt(nChr) == '8')
    szBinBc += "1001001000";
   if (szSsku.GetAt(nChr) == '9')
    szBinBc += "0011001000";
   if (szSsku.GetAt(nChr) == 'A')
    szBinBc += "1000010010";
   if (szSsku.GetAt(nChr) == 'B')
    szBinBc += "0010010010";
   if (szSsku.GetAt(nChr) == 'C')
    szBinBc += "1010010000";
   if (szSsku.GetAt(nChr) == 'D')
    szBinBc += "0000110010";
   if (szSsku.GetAt(nChr) == 'E')
    szBinBc += "1000110000";
   if (szSsku.GetAt(nChr) == 'F')
    szBinBc += "0010110000";
   if (szSsku.GetAt(nChr) == 'G')
    szBinBc += "0000011010";
   if (szSsku.GetAt(nChr) == 'H')
    szBinBc += "1000011000";
   if (szSsku.GetAt(nChr) == 'I')
    szBinBc += "0010011000";
   if (szSsku.GetAt(nChr) == 'J')
    szBinBc += "0000111000";
   if (szSsku.GetAt(nChr) == 'K')
    szBinBc += "1000000110";
   if (szSsku.GetAt(nChr) == 'L')
    szBinBc += "0010000110";
   if (szSsku.GetAt(nChr) == 'M')
    szBinBc += "1010000100";
   if (szSsku.GetAt(nChr) == 'N')
    szBinBc += "0000100110";
   if (szSsku.GetAt(nChr) == 'O')
    szBinBc += "1000100100";
   if (szSsku.GetAt(nChr) == 'P')
    szBinBc += "0010100100";
   if (szSsku.GetAt(nChr) == 'Q')
    szBinBc += "0000001110";
   if (szSsku.GetAt(nChr) == 'R')
    szBinBc += "1000001100";
   if (szSsku.GetAt(nChr) == 'S')
    szBinBc += "0010001100";
   if (szSsku.GetAt(nChr) == 'T')
    szBinBc += "0000101100";
   if (szSsku.GetAt(nChr) == 'U')
    szBinBc += "1100000010";
   if (szSsku.GetAt(nChr) == 'V')
    szBinBc += "0110000010";
   if (szSsku.GetAt(nChr) == 'W')
    szBinBc += "1110000000";
   if (szSsku.GetAt(nChr) == 'X')
    szBinBc += "0100100010";
   if (szSsku.GetAt(nChr) == 'Y')
    szBinBc += "1100100000";
   if (szSsku.GetAt(nChr) == 'Z')
    szBinBc += "0110100000";
   if (szSsku.GetAt(nChr) == '-')
    szBinBc += "0100001010";
   if (szSsku.GetAt(nChr) == '.')
    szBinBc += "1100001000";
   if (szSsku.GetAt(nChr) == ' ')
    szBinBc += "0110001000";
   if (szSsku.GetAt(nChr) == '*')
    szBinBc += "0100101000";
   if (szSsku.GetAt(nChr) == '$')
    szBinBc += "0101010000";
   if (szSsku.GetAt(nChr) == '/')
    szBinBc += "0101000100";
   if (szSsku.GetAt(nChr) == '+')
    szBinBc += "0100010100";
   if (szSsku.GetAt(nChr) == '%')
    szBinBc += "0001010100";
  }
  pDC->TextOut(20,20,szBinBc);
  int  nTimes(3), nAveWidthB(2), nAveWidthS(3);
  /*
  nTimes is how may times wider are the wide bars to narrow bars - usually 3
to 1
  nAveWithB is how may pixels wide is the average narrow bar
  nAveWithS is how may pixels wide is the average narrow space - note this
could be
  different than nAveWIdthsB because we want to make up for the ink runoff
when
  printing bars.
  */
  CPen penBlack(PS_SOLID, 1, RGB(0,0,0));
  CPen penWhite(PS_SOLID, 1, RGB(255,255,255));
  CPen* pOldPen = pDC->SelectObject(&penBlack);
  int  cyText(60), nTms;
  for (nChr = 0; nChr < szBinBc.GetLength(); nChr+=2)
  {
   pDC->SelectObject(&penBlack);
   if (szBinBc.GetAt(nChr) == '1')
   {
    for (nTms = 0; nTms < nTimes*nAveWidthB; nTms++)
    {
     pDC->MoveTo(cyText,40);
     pDC->LineTo(cyText,140);
     cyText++;
    }
   } else
   {
    for (nTms = 0; nTms < nAveWidthB; nTms++)
    {
     pDC->MoveTo(cyText,40);
     pDC->LineTo(cyText,140);
     cyText++;
    }
   }
   pDC->SelectObject(&penWhite);
   if (szBinBc.GetAt(nChr+1) == '1')
   {
    for (nTms = 0; nTms < nTimes*nAveWidthS; nTms++)
    {
     pDC->MoveTo(cyText,40);
     pDC->LineTo(cyText,140);
     cyText++;
    }
   } else
   {
    for (nTms = 0; nTms < nAveWidthS; nTms++)
    {
     pDC->MoveTo(cyText,40);
     pDC->LineTo(cyText,140);
     cyText++;
    }
   }
  }
  pDC->SelectObject(&pOldPen);
 }

- Show quoted text -

Quote:
}



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Integrating a Scanner with Visual Basic

2. Integrating Visual Basic with Powerpoint - reading saved slides into one presentation

3. Integrating visual basic with AS/400

4. How to integrate source control with visual basic.

5. How to integrate source control with visual basic.

6. How to integrate Crystal Reports and Visual Basic

7. Visual Basic integrate Windows NT

8. Visual Basic 6.0 and scanners

9. anyone know how i would implement using a scanner into visual basic,

10. how to use a scanner in visual basic 6.0

11. do Visual Basic 6.0 and Visual Basic .NET version beta Working Both

12. Difference between Visual Basic 6 and Visual Basic.Net

 

 
Powered by phpBB® Forum Software