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);
}
Quote:
}