V2.50 barcode39

svn path=/Slnkdwf/trunk/; revision=12501
This commit is contained in:
Jos Groot Lipman
2011-04-12 09:25:20 +00:00
parent 0cb4f63ea1
commit 8e894a966f
22 changed files with 3454 additions and 5 deletions

0
Barcode/.gitignore vendored
View File

146
Barcode/Barcode.cpp Normal file
View File

@@ -0,0 +1,146 @@
// Barcode.cpp: implementation of the CBarcode class.
//
// Copyright 2002 Neil Van Eps
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Barcode.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CBarcode::CBarcode()
{
}
CBarcode::~CBarcode()
{
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// LoadData()
//
// Description:
//
//
// Arguments:
//
//
// Return:
//
//
// Called by:
//
//
////////////////////////////////////////////////////////////////////////////////////
void CBarcode::LoadData(HDC pDC, CString csMessage, unsigned int nHeight, unsigned int nNarrowBar, unsigned int nWideBar)
{
int i,nTemp;
char c;
m_hDC = pDC;
// values that can be saved without translation
m_csMessage = csMessage;
m_nStartingXPixel = 0;
m_nStartingYPixel = 0;
// load the final attributes that depend on the device context
m_nPixelHeight = nHeight;
m_nNarrowBarPixelWidth = nNarrowBar;
m_nWideBarPixelWidth = nWideBar;
switch (m_nSymbology)
{
case RATIONALCODABAR:
// initialize to zero
m_nFinalBarcodePixelWidth = 0;
// add the width of each character
for (i=0;i<csMessage.GetLength();i++)
{
c = csMessage.GetAt(i);
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case '-':
case '$':
m_nFinalBarcodePixelWidth += (6*m_nNarrowBarPixelWidth)+(2*m_nWideBarPixelWidth);
break;
case ':':
case '/':
case '.':
case '+':
case 'A':
case 'B':
case 'C':
case 'D':
m_nFinalBarcodePixelWidth += (5*m_nNarrowBarPixelWidth)+(3*m_nWideBarPixelWidth);
break;
}
}
break;
case I2OF5:
// add start code
m_nFinalBarcodePixelWidth = 4 * m_nNarrowBarPixelWidth;
// add message
m_nFinalBarcodePixelWidth += ((3*m_nNarrowBarPixelWidth)+(2*m_nWideBarPixelWidth))*m_csMessage.GetLength();
// add stop code
m_nFinalBarcodePixelWidth += (2*m_nNarrowBarPixelWidth)+(m_nWideBarPixelWidth);
break;
case CODE39:
// get final character width
nTemp = m_csMessage.GetLength() + 2;
// add message
m_nFinalBarcodePixelWidth = nTemp * ((3*m_nWideBarPixelWidth) + (7*m_nNarrowBarPixelWidth));
break;
case COD128:
// get final character width
nTemp = m_csMessage.GetLength();
m_nFinalBarcodePixelWidth = ((nTemp*11)+35)*m_nNarrowBarPixelWidth;
break;
case CODE93:
// get final character width
nTemp = m_csMessage.GetLength();
m_nFinalBarcodePixelWidth = (((nTemp+4)*9)+1)*m_nNarrowBarPixelWidth;
case UPCEAN:
case TRADITIONALCODABAR:
break;
}
return;
}
long CBarcode::GetBarcodePixelHeight()
{
return m_nPixelHeight;
}
long CBarcode::GetBarcodePixelWidth()
{
return m_nFinalBarcodePixelWidth;
}

36
Barcode/Barcode.h Normal file
View File

@@ -0,0 +1,36 @@
// Barcode.h: interface for the CBarcode class.
//
// Copyright 2002 Neil Van Eps
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BARCODE_H__C5D7FCDA_5C8F_4244_AF95_33D6FA93F8EB__INCLUDED_)
#define AFX_BARCODE_H__C5D7FCDA_5C8F_4244_AF95_33D6FA93F8EB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CBarcode
{
public:
CBarcode();
void LoadData(HDC pDC, CString csMessage, unsigned int nHeight, unsigned int nNarrowBar, unsigned int nWideBar);
virtual void DrawBitmap() = 0;
virtual ~CBarcode();
long GetBarcodePixelWidth();
long GetBarcodePixelHeight();
protected:
CString m_csMessage;
HDC m_hDC;
long m_nFinalBarcodePixelWidth;
long m_nNarrowBarPixelWidth;
long m_nPixelHeight;
long m_nStartingXPixel;
long m_nStartingYPixel;
long m_nSymbology;
long m_nWideBarPixelWidth;
virtual void DrawPattern(CString csPattern) = 0;
};
#endif // !defined(AFX_BARCODE_H__C5D7FCDA_5C8F_4244_AF95_33D6FA93F8EB__INCLUDED_)

794
Barcode/Code128.cpp Normal file
View File

@@ -0,0 +1,794 @@
// Code128.cpp: implementation of the CCode128 class.
//
// Copyright 2002 Neil Van Eps
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Code128.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCode128::CCode128()
{
// default to subset a
m_nCurrentSubset = SUBSETA;
// code 128
m_nSymbology = COD128;
}
CCode128::~CCode128()
{
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// DrawBitmap()
//
// Description:
// draws a barcode using the previously loaded data
//
// Arguments:
// none
//
// Return:
// void
//
// Called by:
// public class interface
//
////////////////////////////////////////////////////////////////////////////////////
void CCode128::DrawBitmap()
{
long nChar,nNextChar,nCharacterPosition,nCheckDigit;
// calculate the check digit
nCheckDigit = GetCheckDigit();
// draw start character for current subset
if (m_nCurrentSubset==SUBSETA)
DrawPattern(RetrievePattern(103));
else if (m_nCurrentSubset==SUBSETB)
DrawPattern(RetrievePattern(104));
else if (m_nCurrentSubset==SUBSETC)
DrawPattern(RetrievePattern(105));
// initialize position in message
nCharacterPosition = 0;
while (nCharacterPosition < m_csMessage.GetLength())
{
if (m_nCurrentSubset==SUBSETC)
{
// if it's a switch to subsetA - same character (103) for all subsets
if (g_nASCIItoCode128SubsetAB[SUBSETA][m_csMessage.GetAt(nCharacterPosition)]==101)
{
// draw the startA code
DrawPattern(RetrievePattern(101));
// we've moved one message character
nCharacterPosition++;
// actually change the subset
m_nCurrentSubset = SUBSETA;
}
// if it's a switch to subsetB - same character (104) for all subsets
else if (g_nASCIItoCode128SubsetAB[SUBSETA][m_csMessage.GetAt(nCharacterPosition)]==100)
{
// draw the startB code
DrawPattern(RetrievePattern(100));
// we've moved one message character
nCharacterPosition++;
// actually change the subset
m_nCurrentSubset = SUBSETB;
}
// it's FNC1 - just print it out
else if (g_nASCIItoCode128SubsetAB[SUBSETA][m_csMessage.GetAt(nCharacterPosition)]==102)
{
// draw the FNC1
DrawPattern(RetrievePattern(100));
// we've moved one message character
nCharacterPosition++;
}
// it's a digit - pull two at a time
else
{
CString csTemp;
// get the next two characters
csTemp = m_csMessage.Mid(nCharacterPosition,2);
// convert them to longs
nChar = atol((const char *)csTemp);
// draw the code 128 character
DrawPattern(RetrievePattern(nChar));
// we've moved two message characters
nCharacterPosition += 2;
}
}
// we're in SUBSETA or SUBSETB
else
{
// handle upper ASCII characters if necessary
long nTemp2 = m_csMessage.GetAt(nCharacterPosition);
if (nTemp2<-1)
nTemp2 = nTemp2&255;
// retrieve the message character
nChar = g_nASCIItoCode128SubsetAB[m_nCurrentSubset][nTemp2];
// draw the char
DrawPattern(RetrievePattern(nChar));
// we've moved one character position
nCharacterPosition++;
// if switch in SUBSETA
if (m_nCurrentSubset==SUBSETA)
{
if (nChar==100)
m_nCurrentSubset = SUBSETB;
else if (nChar==99)
m_nCurrentSubset = SUBSETC;
}
// if switch in SUBSETB
else if (m_nCurrentSubset==SUBSETB)
{
if (nChar==101)
m_nCurrentSubset = SUBSETA;
else if (nChar==99)
m_nCurrentSubset = SUBSETC;
}
// if a shift character
else if (nChar==98)
{
// shift subsets for the next character only
if (m_nCurrentSubset==SUBSETA)
nNextChar = g_nASCIItoCode128SubsetAB[SUBSETB][m_csMessage.GetAt(nCharacterPosition)];
else
nNextChar = g_nASCIItoCode128SubsetAB[SUBSETA][m_csMessage.GetAt(nCharacterPosition)];
// draw the shifted character
DrawPattern(RetrievePattern(nChar));
// since we've handled two characters advance character position again
nCharacterPosition++;
}
}
}
// draw check digit
DrawPattern(RetrievePattern(nCheckDigit));
// draw stop character
DrawPattern(RetrievePattern(106));
return;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// DrawPattern()
//
// Description:
// draws the passed character pattern at the end of the barcode
//
// Arguments:
// CString csPattern - the bar pattern to draw
//
// Return:
// void
//
// Called by:
// CCode128::DrawBitmap()
//
////////////////////////////////////////////////////////////////////////////////////
void CCode128::DrawPattern(CString csPattern)
{
int i,nXPixel,nYPixel;
// initialize X pixel value
nXPixel = m_nStartingXPixel;
for (i=0;i<csPattern.GetLength();i++)
{
// X value for loop
for (nXPixel=m_nStartingXPixel;nXPixel<m_nStartingXPixel+m_nNarrowBarPixelWidth;nXPixel++)
{
// Y value for loop
for (nYPixel=m_nStartingYPixel;nYPixel<m_nStartingYPixel+m_nPixelHeight;nYPixel++)
{
// if this is a bar
if (csPattern.GetAt(i)=='b')
SetPixelV(m_hDC, nXPixel,nYPixel,COLORBLACK);
else
SetPixelV(m_hDC, nXPixel,nYPixel,COLORWHITE);
}
}
// advance the starting position
m_nStartingXPixel+= m_nNarrowBarPixelWidth;
}
return;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// RetrievePattern()
//
// Description:
// retrieves the bar pattern for a given character
//
// Arguments:
// char cInputCharacter - the input character to get the bar pattern for
//
// Return:
// CString - the bar pattern for the input character
//
// Called by:
// CCode128::DrawBitmap()
//
////////////////////////////////////////////////////////////////////////////////////
CString CCode128::RetrievePattern(long c)
{
CString csCharPattern;
switch (c)
{
case 0:
csCharPattern = "bbsbbssbbss";
break;
case 1:
csCharPattern = "bbssbbsbbss";
break;
case 2:
csCharPattern = "bbssbbssbbs";
break;
case 3:
csCharPattern = "bssbssbbsss";
break;
case 4:
csCharPattern = "bssbsssbbss";
break;
case 5:
csCharPattern = "bsssbssbbss";
break;
case 6:
csCharPattern = "bssbbssbsss";
break;
case 7:
csCharPattern = "bssbbsssbss";
break;
case 8:
csCharPattern = "bsssbbssbss";
break;
case 9:
csCharPattern = "bbssbssbsss";
break;
case 10:
csCharPattern = "bbssbsssbss";
break;
case 11:
csCharPattern = "bbsssbssbss";
break;
case 12:
csCharPattern = "bsbbssbbbss";
break;
case 13:
csCharPattern = "bssbbsbbbss";
break;
case 14:
csCharPattern = "bssbbssbbbs";
break;
case 15:
csCharPattern = "bsbbbssbbss";
break;
case 16:
csCharPattern = "bssbbbsbbss";
break;
case 17:
csCharPattern = "bssbbbssbbs";
break;
case 18:
csCharPattern = "bbssbbbssbs";
break;
case 19:
csCharPattern = "bbssbsbbbss";
break;
case 20:
csCharPattern = "bbssbssbbbs";
break;
case 21:
csCharPattern = "bbsbbbssbss";
break;
case 22:
csCharPattern = "bbssbbbsbss";
break;
case 23:
csCharPattern = "bbbsbbsbbbs";
break;
case 24:
csCharPattern = "bbbsbssbbss";
break;
case 25:
csCharPattern = "bbbssbsbbss";
break;
case 26:
csCharPattern = "bbbssbssbbs";
break;
case 27:
csCharPattern = "bbbsbbssbss";
break;
case 28:
csCharPattern = "bbbssbbsbss";
break;
case 29:
csCharPattern = "bbbssbbssbs";
break;
case 30:
csCharPattern = "bbsbbsbbsss";
break;
case 31:
csCharPattern = "bbsbbsssbbs";
break;
case 32:
csCharPattern = "bbsssbbsbbs";
break;
case 33:
csCharPattern = "bsbsssbbsss";
break;
case 34:
csCharPattern = "bsssbsbbsss";
break;
case 35:
csCharPattern = "bsssbsssbbs";
break;
case 36:
csCharPattern = "bsbbsssbsss";
break;
case 37:
csCharPattern = "bsssbbsbsss";
break;
case 38:
csCharPattern = "bsssbbsssbs";
break;
case 39:
csCharPattern = "bbsbsssbsss";
break;
case 40:
csCharPattern = "bbsssbsbsss";
break;
case 41:
csCharPattern = "bbsssbsssbs";
break;
case 42:
csCharPattern = "bsbbsbbbsss";
break;
case 43:
csCharPattern = "bsbbsssbbbs";
break;
case 44:
csCharPattern = "bsssbbsbbbs";
break;
case 45:
csCharPattern = "bsbbbsbbsss";
break;
case 46:
csCharPattern = "bsbbbsssbbs";
break;
case 47:
csCharPattern = "bsssbbbsbbs";
break;
case 48:
csCharPattern = "bbbsbbbsbbs";
break;
case 49:
csCharPattern = "bbsbsssbbbs";
break;
case 50:
csCharPattern = "bbsssbsbbbs";
break;
case 51:
csCharPattern = "bbsbbbsbsss";
break;
case 52:
csCharPattern = "bbsbbbsssbs";
break;
case 53:
csCharPattern = "bbsbbbsbbbs";
break;
case 54:
csCharPattern = "bbbsbsbbsss";
break;
case 55:
csCharPattern = "bbbsbsssbbs";
break;
case 56:
csCharPattern = "bbbsssbsbbs";
break;
case 57:
csCharPattern = "bbbsbbsbsss";
break;
case 58:
csCharPattern = "bbbsbbsssbs";
break;
case 59:
csCharPattern = "bbbsssbbsbs";
break;
case 60:
csCharPattern = "bbbsbbbbsbs";
break;
case 61:
csCharPattern = "bbssbssssbs";
break;
case 62:
csCharPattern = "bbbbsssbsbs";
break;
case 63:
csCharPattern = "bsbssbbssss";
break;
case 64:
csCharPattern = "bsbssssbbss";
break;
case 65:
csCharPattern = "bssbsbbssss";
break;
case 66:
csCharPattern = "bssbssssbbs";
break;
case 67:
csCharPattern = "bssssbsbbss";
break;
case 68:
csCharPattern = "bssssbssbbs";
break;
case 69:
csCharPattern = "bsbbssbssss";
break;
case 70:
csCharPattern = "bsbbssssbss";
break;
case 71:
csCharPattern = "bssbbsbssss";
break;
case 72:
csCharPattern = "bssbbssssbs";
break;
case 73:
csCharPattern = "bssssbbsbss";
break;
case 74:
csCharPattern = "bssssbbssbs";
break;
case 75:
csCharPattern = "bbssssbssbs";
break;
case 76:
csCharPattern = "bbssbsbssss";
break;
case 77:
csCharPattern = "bbbbsbbbsbs";
break;
case 78:
csCharPattern = "bbssssbsbss";
break;
case 79:
csCharPattern = "bsssbbbbsbs";
break;
case 80:
csCharPattern = "bsbssbbbbss";
break;
case 81:
csCharPattern = "bssbsbbbbss";
break;
case 82:
csCharPattern = "bssbssbbbbs";
break;
case 83:
csCharPattern = "bsbbbbssbss";
break;
case 84:
csCharPattern = "bssbbbbsbss";
break;
case 85:
csCharPattern = "bssbbbbssbs";
break;
case 86:
csCharPattern = "bbbbsbssbss";
break;
case 87:
csCharPattern = "bbbbssbsbss";
break;
case 88:
csCharPattern = "bbbbssbssbs";
break;
case 89:
csCharPattern = "bbsbbsbbbbs";
break;
case 90:
csCharPattern = "bbsbbbbsbbs";
break;
case 91:
csCharPattern = "bbbbsbbsbbs";
break;
case 92:
csCharPattern = "bsbsbbbbsss";
break;
case 93:
csCharPattern = "bsbsssbbbbs";
break;
case 94:
csCharPattern = "bsssbsbbbbs";
break;
case 95:
csCharPattern = "bsbbbbsbsss";
break;
case 96:
csCharPattern = "bsbbbbsssbs";
break;
case 97:
csCharPattern = "bbbbsbsbsss";
break;
case 98:
csCharPattern = "bbbbsbsssbs";
break;
case 99:
csCharPattern = "bsbbbsbbbbs";
break;
case 100:
csCharPattern = "bsbbbbsbbbs";
break;
case 101:
csCharPattern = "bbbsbsbbbbs";
break;
case 102:
csCharPattern = "bbbbsbsbbbs";
break;
case 103:
csCharPattern = "bbsbsbbbbss";
break;
case 104:
csCharPattern = "bbsbssbssss";
break;
case 105:
csCharPattern = "bbsbssbbbss";
break;
case 106:
csCharPattern = "bbsssbbbsbsbb";
break;
}
return csCharPattern;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// AddCheckDigitToMessage()
//
// Description:
// adds the code 128 check digit to the end of the message
//
// Arguments:
// none
//
// Return:
// void
//
// Called by:
// DrawBitmap()
//
////////////////////////////////////////////////////////////////////////////////////
long CCode128::GetCheckDigit()
{
long nSum=0,nCurrentSubset=0,nCode128Char,nNextChar,nWeight,nCharacterPosition;
// start character
if (m_nCurrentSubset==SUBSETA)
{
nSum = 103;
nCurrentSubset = SUBSETA;
}
else if (m_nCurrentSubset==SUBSETB)
{
nSum = 104;
nCurrentSubset = SUBSETB;
}
else if (m_nCurrentSubset==SUBSETC)
{
nSum = 105;
nCurrentSubset = SUBSETC;
}
// intialize the values
nCharacterPosition = 0;
nWeight = 1;
while (nCharacterPosition<(m_csMessage.GetLength()))
{
// if SUBSETC
if (nCurrentSubset==SUBSETC)
{
// if it's a switch to SUBSETA - same character in all subsets
if (g_nASCIItoCode128SubsetAB[SUBSETA][m_csMessage.GetAt(nCharacterPosition)]==101)
{
// we're switching to subsetA
nCode128Char = 101;
// add the change subset character to the sum
nSum+= (nWeight*nCode128Char);
// we've moved one message character
nCharacterPosition++;
// we've moved one weight value
nWeight++;
// actually change the subset
nCurrentSubset = SUBSETA;
}
// if it's a switch to SUBSETB - same character in all subsets
else if (g_nASCIItoCode128SubsetAB[SUBSETA][m_csMessage.GetAt(nCharacterPosition)]==100)
{
// we're switching to subset B
nCode128Char = 100;
// add the change subset character to the sum
nSum+= (nWeight*nCode128Char);
// we've moved one message character
nCharacterPosition++;
// we've moved one weight value
nWeight++;
// actually switch the subset
nCurrentSubset = SUBSETB;
}
// it's FNC1 - just print it out
else if (g_nASCIItoCode128SubsetAB[SUBSETA][m_csMessage.GetAt(nCharacterPosition)]==102)
{
// we're switching to subset B
nCode128Char = 102;
// add the change subset character to the sum
nSum+= (nWeight*nCode128Char);
// we've moved one message character
nCharacterPosition++;
// we've moved one weight value
nWeight++;
}
// its a digit - process two at a time
else
{
CString csTemp;
// get the next two characters
csTemp = m_csMessage.Mid(nCharacterPosition,2);
// convert them to longs
nCode128Char = atol((const char *)csTemp);
// add the weighted balue
nSum += (nWeight*nCode128Char);
// we've moved two message characters
nCharacterPosition += 2;
// we've moved one weight value
nWeight++;
}
}
// it's SUBSETA or SUBSETB
else
{
// handle upper ASCII characters if necessary
long nTemp2 = m_csMessage.GetAt(nCharacterPosition);
if (nTemp2<-1)
nTemp2 = nTemp2&255;
// retrieve the message character
nCode128Char = g_nASCIItoCode128SubsetAB[nCurrentSubset][nTemp2];
// add the weighted value to our sum
nSum+= (nWeight*nCode128Char);
// we've moved one character position
nCharacterPosition++;
// we've moved one weight value
nWeight++;
// if switch in SUBSETA
if (nCurrentSubset==SUBSETA)
{
if (nCode128Char==100)
nCurrentSubset = SUBSETB;
else if (nCode128Char==99)
nCurrentSubset = SUBSETC;
}
// if switch in SUBSETB
else if (nCurrentSubset==SUBSETB)
{
if (nCode128Char==101)
nCurrentSubset = SUBSETA;
else if (nCode128Char==99)
nCurrentSubset = SUBSETC;
}
// handle single character switch
else if (nCode128Char==98)
{
// shift subsets for the next character only
if (nCurrentSubset==SUBSETA)
nNextChar = g_nASCIItoCode128SubsetAB[SUBSETB][m_csMessage.GetAt(nCharacterPosition)];
else
nNextChar = g_nASCIItoCode128SubsetAB[SUBSETA][m_csMessage.GetAt(nCharacterPosition)];
// add weighted value to the sum
nSum += (nWeight*nNextChar);
// since we've handled two characters advance position and weight again
nCharacterPosition++;
nWeight++;
}
}
}
// return the modulus
return (nSum%103);
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// LoadData()
//
// Description:
// overridden to include starting subset
//
// Arguments:
// CString csMessage
// int nSymbology
// double dNarrowBar
// double dFinalHeight
// HDC pDC
// int nStartingXPixel
// int nStartingYPixel
// double dRatio
// long nStartingSubset
//
// Return:
// void
//
// Called by:
// public class interface
//
////////////////////////////////////////////////////////////////////////////////////
void CCode128::LoadData(HDC pDC, CString csMessage, unsigned int dHeight, unsigned int dNarrowBar, unsigned int dWideBar, long nStartingSubset )
{
// call base class version
CBarcode::LoadData(pDC, csMessage, dHeight, dNarrowBar, dWideBar);
// set additional data
m_nCurrentSubset = nStartingSubset;
}

67
Barcode/Code128.h Normal file
View File

@@ -0,0 +1,67 @@
// Code128.h: interface for the CCode128 class.
//
// Copyright 2002 Neil Van Eps
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_CODE128_H__C4FD5D85_50C9_4769_90C0_37A932FD3173__INCLUDED_)
#define AFX_CODE128_H__C4FD5D85_50C9_4769_90C0_37A932FD3173__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Barcode.h"
enum Subsets
{
SUBSETA,
SUBSETB,
SUBSETC
};
const long g_nASCIItoCode128SubsetAB[2][207] ={{64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106},
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106}};
class CCode128 : public CBarcode
{
public:
CCode128();
virtual ~CCode128();
public:
void DrawBitmap();
void LoadData(HDC pDC, CString csMessage, unsigned int nHeight, unsigned int nNarrowBar, unsigned int nWideBar, long nStartingSubset );
private:
long GetCheckDigit();
void DrawPattern(CString csPattern);
CString RetrievePattern(long c);
long m_nCurrentSubset;
};
#endif // !defined(AFX_CODE128_H__C4FD5D85_50C9_4769_90C0_37A932FD3173__INCLUDED_)

277
Barcode/Code39.cpp Normal file
View File

@@ -0,0 +1,277 @@
// Code39.cpp: implementation of the CCode39 class.
//
// Copyright 2002 Neil Van Eps
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Code39.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCode39::CCode39()
{
// code 39
m_nSymbology = CODE39;
}
CCode39::~CCode39()
{
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// DrawBitmap()
//
// Description:
// draws a barcode using the previously loaded data
//
// Arguments:
// none
//
// Return:
// void
//
// Called by:
// public class interface
//
////////////////////////////////////////////////////////////////////////////////////
void CCode39::DrawBitmap()
{
int i;
CString csCurrentPattern;
// draw start character, an asterisk
DrawPattern(RetrievePattern('*'));
// draw each character in the message
for (i=0;i<m_csMessage.GetLength();i++)
DrawPattern(RetrievePattern(m_csMessage.GetAt(i)));
// draw stop character, also an asterisk
DrawPattern(RetrievePattern('*'));
return;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// DrawPattern()
//
// Description:
// draws the passed character pattern at the end of the barcode
//
// Arguments:
// CString csPattern - the bar pattern to draw
//
// Return:
// void
//
// Called by:
// CRationalCodabar::DrawBitmap()
//
////////////////////////////////////////////////////////////////////////////////////
void CCode39::DrawPattern( CString csPattern )
{
int i,nXPixel,nYPixel,nTempWidth;
// initialize X pixel value
nXPixel = m_nStartingXPixel;
for (i=0;i<csPattern.GetLength();i++)
{
// decide if narrow or wide bar
if (csPattern.GetAt(i)=='n')
nTempWidth = m_nNarrowBarPixelWidth;
else
nTempWidth = m_nWideBarPixelWidth;
// X value for loop
for (nXPixel=m_nStartingXPixel;nXPixel<m_nStartingXPixel+nTempWidth;nXPixel++)
{
// Y value for loop
for (nYPixel=m_nStartingYPixel;nYPixel<m_nStartingYPixel+m_nPixelHeight;nYPixel++)
{
// if this is a bar
if (i%2==0)
SetPixelV(m_hDC, nXPixel,nYPixel,COLORBLACK);
else
SetPixelV(m_hDC, nXPixel,nYPixel,COLORWHITE);
}
}
// advance the starting position
m_nStartingXPixel+= nTempWidth;
}
return;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// RetrievePattern()
//
// Description:
// retrieves the bar pattern for a given character
//
// Arguments:
// char cInputCharacter - the input character to get the bar pattern for
//
// Return:
// CString - the bar pattern for the input character
//
// Called by:
// CRationalCodabar::DrawBitmap()
//
////////////////////////////////////////////////////////////////////////////////////
CString CCode39::RetrievePattern(char c)
{
CString csCharPattern;
switch (c)
{
case '1':
csCharPattern = "wnnwnnnnwn";
break;
case '2':
csCharPattern = "nnwwnnnnwn";
break;
case '3':
csCharPattern = "wnwwnnnnnn";
break;
case '4':
csCharPattern = "nnnwwnnnwn";
break;
case '5':
csCharPattern = "wnnwwnnnnn";
break;
case '6':
csCharPattern = "nnwwwnnnnn";
break;
case '7':
csCharPattern = "nnnwnnwnwn";
break;
case '8':
csCharPattern = "wnnwnnwnnn";
break;
case '9':
csCharPattern = "nnwwnnwnnn";
break;
case '0':
csCharPattern = "nnnwwnwnnn";
break;
case 'A':
csCharPattern = "wnnnnwnnwn";
break;
case 'B':
csCharPattern = "nnwnnwnnwn";
break;
case 'C':
csCharPattern = "wnwnnwnnnn";
break;
case 'D':
csCharPattern = "nnnnwwnnwn";
break;
case 'E':
csCharPattern = "wnnnwwnnnn";
break;
case 'F':
csCharPattern = "nnwnwwnnnn";
break;
case 'G':
csCharPattern = "nnnnnwwnwn";
break;
case 'H':
csCharPattern = "wnnnnwwnnn";
break;
case 'I':
csCharPattern = "nnwnnwwnnn";
break;
case 'J':
csCharPattern = "nnnnwwwnnn";
break;
case 'K':
csCharPattern = "wnnnnnnwwn";
break;
case 'L':
csCharPattern = "nnwnnnnwwn";
break;
case 'M':
csCharPattern = "wnwnnnnwnn";
break;
case 'N':
csCharPattern = "nnnnwnnwwn";
break;
case 'O':
csCharPattern = "wnnnwnnwnn";
break;
case 'P':
csCharPattern = "nnwnwnnwnn";
break;
case 'Q':
csCharPattern = "nnnnnnwwwn";
break;
case 'R':
csCharPattern = "wnnnnnwwnn";
break;
case 'S':
csCharPattern = "nnwnnnwwnn";
break;
case 'T':
csCharPattern = "nnnnwnwwnn";
break;
case 'U':
csCharPattern = "wwnnnnnnwn";
break;
case 'V':
csCharPattern = "nwwnnnnnwn";
break;
case 'W':
csCharPattern = "wwwnnnnnnn";
break;
case 'X':
csCharPattern = "nwnnwnnnwn";
break;
case 'Y':
csCharPattern = "wwnnwnnnnn";
break;
case 'Z':
csCharPattern = "nwwnwnnnnn";
break;
case '-':
csCharPattern = "nwnnnnwnwn";
break;
case '.':
csCharPattern = "wwnnnnwnnn";
break;
case ' ':
csCharPattern = "nwwnnnwnnn";
break;
case '*':
csCharPattern = "nwnnwnwnnn";
break;
case '$':
csCharPattern = "nwnwnwnnnn";
break;
case '/':
csCharPattern = "nwnwnnnwnn";
break;
case '+':
csCharPattern = "nwnnnwnwnn";
break;
case '%':
csCharPattern = "nnnwnwnwnn";
break;
}
return csCharPattern;
}

28
Barcode/Code39.h Normal file
View File

@@ -0,0 +1,28 @@
// Code39.h: interface for the CCode39 class.
//
// Copyright 2002 Neil Van Eps
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_CODE39_H__6FE17747_EADF_4E89_9DCF_7688B04897BC__INCLUDED_)
#define AFX_CODE39_H__6FE17747_EADF_4E89_9DCF_7688B04897BC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Barcode.h"
class CCode39 : public CBarcode
{
public:
void DrawBitmap();
CCode39();
virtual ~CCode39();
private:
void DrawPattern(CString csPattern);
CString RetrievePattern( char c );
};
#endif // !defined(AFX_CODE39_H__6FE17747_EADF_4E89_9DCF_7688B04897BC__INCLUDED_)

918
Barcode/Code93.cpp Normal file
View File

@@ -0,0 +1,918 @@
// Code93.cpp: implementation of the CCode93 class.
//
// Copyright 2002 Neil Van Eps
//
/////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Code93.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCode93::CCode93()
{
// code 93
m_nSymbology = CODE93;
}
CCode93::~CCode93()
{
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// DrawBitmap()
//
// Description:
// draws a barcode using the previously loaded data
//
// Arguments:
// none
//
// Return:
// void
//
// Called by:
// public class interface
//
////////////////////////////////////////////////////////////////////////////////////
void CCode93::DrawBitmap()
{
long i,nFirstNumber,nSecondNumber;
CString csCurrentPattern;
// draw start character
DrawPattern(RetrievePattern(47));
// draw each character in the message
for (i=0;i<m_csMessage.GetLength();i++)
{
// get current ASCII character
ASCIItoCode93Sequence((long)m_csMessage.GetAt(i),&nFirstNumber,&nSecondNumber);
DrawPattern(RetrievePattern(nFirstNumber));
if (nSecondNumber!=-1)
DrawPattern(RetrievePattern(nSecondNumber));
}
// add the check digit characters
DrawCheckDigits();
// draw stop character
DrawPattern(RetrievePattern(48));
return;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// DrawPattern()
//
// Description:
// draws the passed character pattern at the end of the barcode
//
// Arguments:
// CString csPattern - the bar pattern to draw
//
// Return:
// void
//
// Called by:
// CRationalCodabar::DrawBitmap()
//
////////////////////////////////////////////////////////////////////////////////////
void CCode93::DrawPattern( CString csPattern )
{
int i,nXPixel,nYPixel;
// initialize X pixel value
nXPixel = m_nStartingXPixel;
for (i=0;i<csPattern.GetLength();i++)
{
// X value for loop
for (nXPixel=m_nStartingXPixel;nXPixel<m_nStartingXPixel+m_nNarrowBarPixelWidth;nXPixel++)
{
// Y value for loop
for (nYPixel=m_nStartingYPixel;nYPixel<m_nStartingYPixel+m_nPixelHeight;nYPixel++)
{
// if this is a bar
if (csPattern.GetAt(i)=='b')
SetPixelV(m_hDC, nXPixel,nYPixel,COLORBLACK);
else
SetPixelV(m_hDC, nXPixel,nYPixel,COLORWHITE);
}
}
// advance the starting position
m_nStartingXPixel+= m_nNarrowBarPixelWidth;
}
return;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// RetrievePattern()
//
// Description:
// retrieves the bar pattern for a given character
//
// Arguments:
// char cInputCharacter - the input character to get the bar pattern for
//
// Return:
// CString - the bar pattern for the input character
//
// Called by:
// CCode93::DrawBitmap()
//
////////////////////////////////////////////////////////////////////////////////////
CString CCode93::RetrievePattern(long c)
{
CString csCharPattern;
// Code93 characters follow are all 9 narrow bar elements wide
// b - bar element
// s - space element
// 9 elements in all
switch (c)
{
case 0:
csCharPattern = "bsssbsbss";
break;
case 1:
csCharPattern = "bsbssbsss";
break;
case 2:
csCharPattern = "bsbsssbss";
break;
case 3:
csCharPattern = "bsbssssbs";
break;
case 4:
csCharPattern = "bssbsbsss";
break;
case 5:
csCharPattern = "bssbssbss";
break;
case 6:
csCharPattern = "bssbsssbs";
break;
case 7:
csCharPattern = "bsbsbssss";
break;
case 8:
csCharPattern = "bsssbssbs";
break;
case 9:
csCharPattern = "bssssbsbs";
break;
case 10:
csCharPattern = "bbsbsbsss";
break;
case 11:
csCharPattern = "bbsbssbss";
break;
case 12:
csCharPattern = "bbsbsssbs";
break;
case 13:
csCharPattern = "bbssbsbss";
break;
case 14:
csCharPattern = "bbssbssbs";
break;
case 15:
csCharPattern = "bbsssbsbs";
break;
case 16:
csCharPattern = "bsbbsbsss";
break;
case 17:
csCharPattern = "bsbbssbss";
break;
case 18:
csCharPattern = "bsbbsssbs";
break;
case 19:
csCharPattern = "bssbbsbss";
break;
case 20:
csCharPattern = "bsssbbsbs";
break;
case 21:
csCharPattern = "bsbsbbsss";
break;
case 22:
csCharPattern = "bsbssbbss";
break;
case 23:
csCharPattern = "bsbsssbbs";
break;
case 24:
csCharPattern = "bssbsbbss";
break;
case 25:
csCharPattern = "bsssbsbbs";
break;
case 26:
csCharPattern = "bbsbbsbss";
break;
case 27:
csCharPattern = "bbsbbssbs";
break;
case 28:
csCharPattern = "bbsbsbbss";
break;
case 29:
csCharPattern = "bbsbssbbs";
break;
case 30:
csCharPattern = "bbssbsbbs";
break;
case 31:
csCharPattern = "bbssbbsbs";
break;
case 32:
csCharPattern = "bsbbsbbss";
break;
case 33:
csCharPattern = "bsbbssbbs";
break;
case 34:
csCharPattern = "bssbbsbbs";
break;
case 35:
csCharPattern = "bssbbbsbs";
break;
case 36:
csCharPattern = "bssbsbbbs";
break;
case 37:
csCharPattern = "bbbsbsbss";
break;
case 38:
csCharPattern = "bbbsbssbs";
break;
case 39:
csCharPattern = "bbbssbsbs";
break;
case 40:
csCharPattern = "bsbbsbbbs";
break;
case 41:
csCharPattern = "bsbbbsbbs";
break;
case 42:
csCharPattern = "bbsbsbbbs";
break;
case 43:
csCharPattern = "bssbssbbs";
break;
case 44:
csCharPattern = "bbbsbbsbs";
break;
case 45:
csCharPattern = "bbbsbsbbs";
break;
case 46:
csCharPattern = "bssbbssbs";
break;
case 47:
csCharPattern = "bsbsbbbbs";
break;
case 48:
csCharPattern = "bsbsbbbbsb";
break;
}
return csCharPattern;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// AddCheckDigitsToMessage()
//
// Description:
// Adds the two code93 check digits to the end of the message
//
// Arguments:
// none
//
// Return:
// void
//
// Called by:
// CCode93::DrawBitmap()
//
////////////////////////////////////////////////////////////////////////////////////
void CCode93::DrawCheckDigits()
{
long i,nSum,nWeight,nFirstNumber,nSecondNumber;
// "C" check digit character
nWeight = 1;
nSum = 0;
for (i=m_csMessage.GetLength()-1;i>-1;i--)
{
ASCIItoCode93Sequence((long)m_csMessage.GetAt(i),&nFirstNumber,&nSecondNumber);
// add to the sum
nSum += (nWeight * nFirstNumber);
nWeight++;
if (nWeight>20)
nWeight=1;
// if its a two sequence character
if (nSecondNumber!=-1)
{
nSum += (nWeight * nSecondNumber);
nWeight++;
if (nWeight>20)
nWeight=1;
}
}
// draw the "C" check digit character
DrawPattern(RetrievePattern(nSum%47));
// "K" check digit character - include the "C" check digit character in calculations
nWeight = 2;
nSum = nSum%47;
for (i=m_csMessage.GetLength()-1;i>-1;i--)
{
ASCIItoCode93Sequence((long)m_csMessage.GetAt(i),&nFirstNumber,&nSecondNumber);
// add to the sum
nSum += (nWeight * nFirstNumber);
nWeight++;
if (nWeight>15)
nWeight=1;
// if its a two sequence character
if (nSecondNumber!=-1)
{
nSum += (nWeight * nSecondNumber);
nWeight++;
if (nWeight>15)
nWeight=1;
}
}
// draw the "K" check digit character
DrawPattern(RetrievePattern(nSum%47));
return;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// ASCIItoCode93Sequence()
//
// Description:
// translates an ASCII character into the appropriate CODE93 sequence
//
// Arguments:
// long nFirstNumber - first number of the code93 sequence
// long nSecondNumber - second number of the code93 sequence, -1 if not applicable
//
// Return:
// void
//
// Called by:
// CCode93::DrawBitmap(), CCode93::DrawCheckDigits()
//
////////////////////////////////////////////////////////////////////////////////////
void CCode93::ASCIItoCode93Sequence(long nASCIINumber,long *nFirstNumber, long *nSecondNumber)
{
switch (nASCIINumber)
{
case 0:
*nFirstNumber = 44;
*nSecondNumber = 30;
break;
case 1:
*nFirstNumber = 43;
*nSecondNumber = 10;
break;
case 2:
*nFirstNumber = 43;
*nSecondNumber = 11;
break;
case 3:
*nFirstNumber = 43;
*nSecondNumber = 12;
break;
case 4:
*nFirstNumber = 43;
*nSecondNumber = 13;
break;
case 5:
*nFirstNumber = 43;
*nSecondNumber = 14;
break;
case 6:
*nFirstNumber = 43;
*nSecondNumber = 15;
break;
case 7:
*nFirstNumber = 43;
*nSecondNumber = 16;
break;
case 8:
*nFirstNumber = 43;
*nSecondNumber = 17;
break;
case 9:
*nFirstNumber = 43;
*nSecondNumber = 18;
break;
case 10:
*nFirstNumber = 43;
*nSecondNumber = 19;
break;
case 11:
*nFirstNumber = 43;
*nSecondNumber = 20;
break;
case 12:
*nFirstNumber = 43;
*nSecondNumber = 21;
break;
case 13:
*nFirstNumber = 43;
*nSecondNumber = 22;
break;
case 14:
*nFirstNumber = 43;
*nSecondNumber = 23;
break;
case 15:
*nFirstNumber = 43;
*nSecondNumber = 24;
break;
case 16:
*nFirstNumber = 43;
*nSecondNumber = 25;
break;
case 17:
*nFirstNumber = 43;
*nSecondNumber = 26;
break;
case 18:
*nFirstNumber = 43;
*nSecondNumber = 27;
break;
case 19:
*nFirstNumber = 43;
*nSecondNumber = 28;
break;
case 20:
*nFirstNumber = 43;
*nSecondNumber = 29;
break;
case 21:
*nFirstNumber = 43;
*nSecondNumber = 30;
break;
case 22:
*nFirstNumber = 43;
*nSecondNumber = 31;
break;
case 23:
*nFirstNumber = 43;
*nSecondNumber = 32;
break;
case 24:
*nFirstNumber = 43;
*nSecondNumber = 33;
break;
case 25:
*nFirstNumber = 43;
*nSecondNumber = 34;
break;
case 26:
*nFirstNumber = 43;
*nSecondNumber = 35;
break;
case 27:
*nFirstNumber = 44;
*nSecondNumber = 10;
break;
case 28:
*nFirstNumber = 44;
*nSecondNumber = 11;
break;
case 29:
*nFirstNumber = 44;
*nSecondNumber = 12;
break;
case 30:
*nFirstNumber = 44;
*nSecondNumber = 13;
break;
case 31:
*nFirstNumber = 44;
*nSecondNumber = 14;
break;
case 32:
*nFirstNumber = 38;
*nSecondNumber = -1;
break;
case 33:
*nFirstNumber = 45;
*nSecondNumber = 10;
break;
case 34:
*nFirstNumber = 45;
*nSecondNumber = 11;
break;
case 35:
*nFirstNumber = 45;
*nSecondNumber = 12;
break;
case 36:
*nFirstNumber = 39;
*nSecondNumber = -1;
break;
case 37:
*nFirstNumber = 42;
*nSecondNumber = -1;
break;
case 38:
*nFirstNumber = 45;
*nSecondNumber = 15;
break;
case 39:
*nFirstNumber = 45;
*nSecondNumber = 16;
break;
case 40:
*nFirstNumber = 45;
*nSecondNumber = 17;
break;
case 41:
*nFirstNumber = 45;
*nSecondNumber = 18;
break;
case 42:
*nFirstNumber = 45;
*nSecondNumber = 19;
break;
case 43:
*nFirstNumber = 41;
*nSecondNumber = -1;
break;
case 44:
*nFirstNumber = 45;
*nSecondNumber = 21;
break;
case 45:
*nFirstNumber = 36;
*nSecondNumber = -1;
break;
case 46:
*nFirstNumber = 37;
*nSecondNumber = -1;
break;
case 47:
*nFirstNumber = 40;
*nSecondNumber = -1;
break;
case 48:
*nFirstNumber = 0;
*nSecondNumber = -1;
break;
case 49:
*nFirstNumber = 1;
*nSecondNumber = -1;
break;
case 50:
*nFirstNumber = 2;
*nSecondNumber = -1;
break;
case 51:
*nFirstNumber = 3;
*nSecondNumber = -1;
break;
case 52:
*nFirstNumber = 4;
*nSecondNumber = -1;
break;
case 53:
*nFirstNumber = 5;
*nSecondNumber = -1;
break;
case 54:
*nFirstNumber = 6;
*nSecondNumber = -1;
break;
case 55:
*nFirstNumber = 7;
*nSecondNumber = -1;
break;
case 56:
*nFirstNumber = 8;
*nSecondNumber = -1;
break;
case 57:
*nFirstNumber = 9;
*nSecondNumber = -1;
break;
case 58:
*nFirstNumber = 45;
*nSecondNumber = 35;
break;
case 59:
*nFirstNumber = 44;
*nSecondNumber = 15;
break;
case 60:
*nFirstNumber = 44;
*nSecondNumber = 16;
break;
case 61:
*nFirstNumber = 44;
*nSecondNumber = 17;
break;
case 62:
*nFirstNumber = 44;
*nSecondNumber = 18;
break;
case 63:
*nFirstNumber = 44;
*nSecondNumber = 19;
break;
case 64:
*nFirstNumber = 44;
*nSecondNumber = 31;
break;
case 65:
*nFirstNumber = 10;
*nSecondNumber = -1;
break;
case 66:
*nFirstNumber = 11;
*nSecondNumber = -1;
break;
case 67:
*nFirstNumber = 12;
*nSecondNumber = -1;
break;
case 68:
*nFirstNumber = 13;
*nSecondNumber = -1;
break;
case 69:
*nFirstNumber = 14;
*nSecondNumber = -1;
break;
case 70:
*nFirstNumber = 15;
*nSecondNumber = -1;
break;
case 71:
*nFirstNumber = 16;
*nSecondNumber = -1;
break;
case 72:
*nFirstNumber = 17;
*nSecondNumber = -1;
break;
case 73:
*nFirstNumber = 18;
*nSecondNumber = -1;
break;
case 74:
*nFirstNumber = 19;
*nSecondNumber = -1;
break;
case 75:
*nFirstNumber = 20;
*nSecondNumber = -1;
break;
case 76:
*nFirstNumber = 21;
*nSecondNumber = -1;
break;
case 77:
*nFirstNumber = 22;
*nSecondNumber = -1;
break;
case 78:
*nFirstNumber = 23;
*nSecondNumber = -1;
break;
case 79:
*nFirstNumber = 24;
*nSecondNumber = -1;
break;
case 80:
*nFirstNumber = 25;
*nSecondNumber = -1;
break;
case 81:
*nFirstNumber = 26;
*nSecondNumber = -1;
break;
case 82:
*nFirstNumber = 27;
*nSecondNumber = -1;
break;
case 83:
*nFirstNumber = 28;
*nSecondNumber = -1;
break;
case 84:
*nFirstNumber = 29;
*nSecondNumber = -1;
break;
case 85:
*nFirstNumber = 30;
*nSecondNumber = -1;
break;
case 86:
*nFirstNumber = 31;
*nSecondNumber = -1;
break;
case 87:
*nFirstNumber = 32;
*nSecondNumber = -1;
break;
case 88:
*nFirstNumber = 33;
*nSecondNumber = -1;
break;
case 89:
*nFirstNumber = 34;
*nSecondNumber = -1;
break;
case 90:
*nFirstNumber = 35;
*nSecondNumber = -1;
break;
case 91:
*nFirstNumber = 44;
*nSecondNumber = 20;
break;
case 92:
*nFirstNumber = 44;
*nSecondNumber = 21;
break;
case 93:
*nFirstNumber = 44;
*nSecondNumber = 22;
break;
case 94:
*nFirstNumber = 44;
*nSecondNumber = 23;
break;
case 95:
*nFirstNumber = 44;
*nSecondNumber = 24;
break;
case 96:
*nFirstNumber = 44;
*nSecondNumber = 32;
break;
case 97:
*nFirstNumber = 46;
*nSecondNumber = 10;
break;
case 98:
*nFirstNumber = 46;
*nSecondNumber = 11;
break;
case 99:
*nFirstNumber = 46;
*nSecondNumber = 12;
break;
case 100:
*nFirstNumber = 46;
*nSecondNumber = 13;
break;
case 101:
*nFirstNumber = 46;
*nSecondNumber = 14;
break;
case 102:
*nFirstNumber = 46;
*nSecondNumber = 15;
break;
case 103:
*nFirstNumber = 46;
*nSecondNumber = 16;
break;
case 104:
*nFirstNumber = 46;
*nSecondNumber = 17;
break;
case 105:
*nFirstNumber = 46;
*nSecondNumber = 18;
break;
case 106:
*nFirstNumber = 46;
*nSecondNumber = 19;
break;
case 107:
*nFirstNumber = 46;
*nSecondNumber = 20;
break;
case 108:
*nFirstNumber = 46;
*nSecondNumber = 21;
break;
case 109:
*nFirstNumber = 46;
*nSecondNumber = 22;
break;
case 110:
*nFirstNumber = 46;
*nSecondNumber = 23;
break;
case 111:
*nFirstNumber = 46;
*nSecondNumber = 24;
break;
case 112:
*nFirstNumber = 46;
*nSecondNumber = 25;
break;
case 113:
*nFirstNumber = 46;
*nSecondNumber = 26;
break;
case 114:
*nFirstNumber = 46;
*nSecondNumber = 27;
break;
case 115:
*nFirstNumber = 46;
*nSecondNumber = 28;
break;
case 116:
*nFirstNumber = 46;
*nSecondNumber = 29;
break;
case 117:
*nFirstNumber = 46;
*nSecondNumber = 30;
break;
case 118:
*nFirstNumber = 46;
*nSecondNumber = 31;
break;
case 119:
*nFirstNumber = 46;
*nSecondNumber = 32;
break;
case 120:
*nFirstNumber = 46;
*nSecondNumber = 33;
break;
case 121:
*nFirstNumber = 46;
*nSecondNumber = 34;
break;
case 122:
*nFirstNumber = 46;
*nSecondNumber = 35;
break;
case 123:
*nFirstNumber = 44;
*nSecondNumber = 25;
break;
case 124:
*nFirstNumber = 44;
*nSecondNumber = 26;
break;
case 125:
*nFirstNumber = 44;
*nSecondNumber = 27;
break;
case 126:
*nFirstNumber = 44;
*nSecondNumber = 28;
break;
case 127:
*nFirstNumber = 44;
*nSecondNumber = 29;
break;
}
}

30
Barcode/Code93.h Normal file
View File

@@ -0,0 +1,30 @@
// Code93.h: interface for the CCode93 class.
//
// Copyright 2002 Neil Van Eps
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_CODE93_H__9559F813_425A_11D6_8807_00104B2B0208__INCLUDED_)
#define AFX_CODE93_H__9559F813_425A_11D6_8807_00104B2B0208__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Barcode.h"
class CCode93 : public CBarcode
{
public:
CCode93();
virtual ~CCode93();
void DrawBitmap();
private:
void ASCIItoCode93Sequence( long nASCIINumber,long *nFirstNumber, long *nSecondNumber);
void DrawCheckDigits();
void DrawPattern(CString csPattern);
CString RetrievePattern( long c );
};
#endif // !defined(AFX_CODE93_H__9559F813_425A_11D6_8807_00104B2B0208__INCLUDED_)

452
Barcode/I2of5.cpp Normal file
View File

@@ -0,0 +1,452 @@
// I2of5.cpp: implementation of the CI2of5 class.
//
// Copyright 2002 Neil Van Eps
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "I2of5.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CI2of5::CI2of5()
{
// I2of5
m_nSymbology = I2OF5;
}
CI2of5::~CI2of5()
{
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// DrawBitmap()
//
// Description:
// draws a barcode using the previously loaded data
//
// Arguments:
// none
//
// Return:
// void
//
// Called by:
// public class interface
//
////////////////////////////////////////////////////////////////////////////////////
void CI2of5::DrawBitmap()
{
int i,nNumber;
// draw the start character
DrawPattern("nnnn");
// for each character in the message
for (i=0;i<m_csMessage.GetLength();i+=2)
{
// retrieve the next two digit number
nNumber = m_csMessage.GetAt(i) - '0';
nNumber = nNumber * 10;
nNumber += m_csMessage.GetAt(i+1) - '0';
// draw the two digit number
DrawPattern(RetrievePattern(nNumber));
}
// draw the stop character
DrawPattern("wnn");
return;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// DrawPattern()
//
// Description:
// draws the passed character pattern at the end of the barcode
//
// Arguments:
// CString csPattern - the bar pattern to draw
//
// Return:
// void
//
// Called by:
// CRationalCodabar::DrawBitmap()
//
////////////////////////////////////////////////////////////////////////////////////
void CI2of5::DrawPattern(CString csCharPattern)
{
int i,nXPixel,nYPixel,nTempWidth;
// initialize X pixel value
nXPixel = m_nStartingXPixel;
for (i=0;i<csCharPattern.GetLength();i++)
{
// decide if narrow or wide bar
if (csCharPattern.GetAt(i)=='n')
nTempWidth = m_nNarrowBarPixelWidth;
else
nTempWidth = m_nWideBarPixelWidth;
// X value for loop
for (nXPixel=m_nStartingXPixel;nXPixel<m_nStartingXPixel+nTempWidth;nXPixel++)
{
// Y value for loop
for (nYPixel=m_nStartingYPixel;nYPixel<m_nStartingYPixel+m_nPixelHeight;nYPixel++)
{
// if this is a bar
if (i%2==0)
SetPixelV(m_hDC, nXPixel,nYPixel,COLORBLACK);
else
SetPixelV(m_hDC, nXPixel,nYPixel,COLORWHITE);
}
}
// advance the starting position
m_nStartingXPixel+= nTempWidth;
}
return;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// RetrievePattern()
//
// Description:
// retrieves the bar pattern for a given character
//
// Arguments:
// char cInputCharacter - the input character to get the bar pattern for
//
// Return:
// CString - the bar pattern for the input character
//
// Called by:
// CRationalCodabar::DrawBitmap()
//
////////////////////////////////////////////////////////////////////////////////////
CString CI2of5::RetrievePattern(int nTwoDigitNumber)
{
CString csCharPattern;
switch (nTwoDigitNumber)
{
case 0:
csCharPattern = "nnnnwwwwnn";
break;
case 1:
csCharPattern = "nwnnwnwnnw";
break;
case 2:
csCharPattern = "nnnwwnwnnw";
break;
case 3:
csCharPattern = "nwnwwnwnnn";
break;
case 4:
csCharPattern = "nnnnwwwnnw";
break;
case 5:
csCharPattern = "nwnnwwwnnn";
break;
case 6:
csCharPattern = "nnnwwwwnnn";
break;
case 7:
csCharPattern = "nnnnwnwwnw";
break;
case 8:
csCharPattern = "nwnnwnwwnn";
break;
case 9:
csCharPattern = "nnnwwnwwnn";
break;
case 10:
csCharPattern = "wnnnnwnwwn";
break;
case 11:
csCharPattern = "wwnnnnnnww";
break;
case 12:
csCharPattern = "wnnwnnnnww";
break;
case 13:
csCharPattern = "wwnwnnnnwn";
break;
case 14:
csCharPattern = "wnnnnwnnww";
break;
case 15:
csCharPattern = "wwnnnwnnwn";
break;
case 16:
csCharPattern = "wnnwnwnnwn";
break;
case 17:
csCharPattern = "wnnnnnnwww";
break;
case 18:
csCharPattern = "wwnnnnnwwn";
break;
case 19:
csCharPattern = "wnnwnnnwwn";
break;
case 20:
csCharPattern = "nnwnnwnwwn";
break;
case 21:
csCharPattern = "nwwnnnnnww";
break;
case 22:
csCharPattern = "nnwwnnnnww";
break;
case 23:
csCharPattern = "nwwwnnnnwn";
break;
case 24:
csCharPattern = "nnwnnwnnww";
break;
case 25:
csCharPattern = "nwwnnwnnwn";
break;
case 26:
csCharPattern = "nnwwnwnnwn";
break;
case 27:
csCharPattern = "nnwnnnnwww";
break;
case 28:
csCharPattern = "nwwnnnnwwn";
break;
case 29:
csCharPattern = "nnwwnnnwwn";
break;
case 30:
csCharPattern = "wnwnnwnwnn";
break;
case 31:
csCharPattern = "wwwnnnnnnw";
break;
case 32:
csCharPattern = "wnwwnnnnnw";
break;
case 33:
csCharPattern = "wwwwnnnnnn";
break;
case 34:
csCharPattern = "wnwnnwnnnw";
break;
case 35:
csCharPattern = "wwwnnwnnnn";
break;
case 36:
csCharPattern = "wnwwnwnnnn";
break;
case 37:
csCharPattern = "wnwnnnnwnw";
break;
case 38:
csCharPattern = "wwwnnnnwnn";
break;
case 39:
csCharPattern = "wnwwnnnwnn";
break;
case 40:
csCharPattern = "nnnnwwnwwn";
break;
case 41:
csCharPattern = "nwnnwnnnww";
break;
case 42:
csCharPattern = "nnnwwnnnww";
break;
case 43:
csCharPattern = "nwnwwnnnwn";
break;
case 44:
csCharPattern = "nnnnwwnnww";
break;
case 45:
csCharPattern = "nwnnwwnnwn";
break;
case 46:
csCharPattern = "nnnwwwnnwn";
break;
case 47:
csCharPattern = "nnnnwnnwww";
break;
case 48:
csCharPattern = "nwnnwnnwwn";
break;
case 49:
csCharPattern = "nnnwwnnwwn";
break;
case 50:
csCharPattern = "wnnnwwnwnn";
break;
case 51:
csCharPattern = "wwnnwnnnnw";
break;
case 52:
csCharPattern = "wnnwwnnnnw";
break;
case 53:
csCharPattern = "wwnwwnnnnn";
break;
case 54:
csCharPattern = "wnnnwwnnnw";
break;
case 55:
csCharPattern = "wwnnwwnnnn";
break;
case 56:
csCharPattern = "wnnwwwnnnn";
break;
case 57:
csCharPattern = "wnnnwnnwnw";
break;
case 58:
csCharPattern = "wwnnwnnwnn";
break;
case 59:
csCharPattern = "wnnwwnnwnn";
break;
case 60:
csCharPattern = "nnwnwwnwnn";
break;
case 61:
csCharPattern = "nwwnwnnnnw";
break;
case 62:
csCharPattern = "nnwwwnnnnw";
break;
case 63:
csCharPattern = "nwwwwnnnnn";
break;
case 64:
csCharPattern = "nnwnwwnnnw";
break;
case 65:
csCharPattern = "nwwnwwnnnn";
break;
case 66:
csCharPattern = "nnwwwwnnnn";
break;
case 67:
csCharPattern = "nnwnwnnwnw";
break;
case 68:
csCharPattern = "nwwnwnnwnn";
break;
case 69:
csCharPattern = "nnwwwnnwnn";
break;
case 70:
csCharPattern = "nnnnnwwwwn";
break;
case 71:
csCharPattern = "nwnnnnwnww";
break;
case 72:
csCharPattern = "nnnwnnwnww";
break;
case 73:
csCharPattern = "nwnwnnwnwn";
break;
case 74:
csCharPattern = "nnnnnwwnww";
break;
case 75:
csCharPattern = "nwnnnwwnwn";
break;
case 76:
csCharPattern = "nnnwnwwnwn";
break;
case 77:
csCharPattern = "nnnnnnwwww";
break;
case 78:
csCharPattern = "nwnnnnwwwn";
break;
case 79:
csCharPattern = "nnnwnnwwwn";
break;
case 80:
csCharPattern = "wnnnnwwwnn";
break;
case 81:
csCharPattern = "wwnnnnwnnw";
break;
case 82:
csCharPattern = "wnnwnnwnnw";
break;
case 83:
csCharPattern = "wwnwnnwnnn";
break;
case 84:
csCharPattern = "wnnnnwwnnw";
break;
case 85:
csCharPattern = "wwnnnwwnnn";
break;
case 86:
csCharPattern = "wnnwnwwnnn";
break;
case 87:
csCharPattern = "wnnnnnwwnw";
break;
case 88:
csCharPattern = "wwnnnnwwnn";
break;
case 89:
csCharPattern = "wnnwnnwwnn";
break;
case 90:
csCharPattern = "nnwnnwwwnn";
break;
case 91:
csCharPattern = "nwwnnnwnnw";
break;
case 92:
csCharPattern = "nnwwnnwnnw";
break;
case 93:
csCharPattern = "nwwwnnwnnn";
break;
case 94:
csCharPattern = "nnwnnwwnnw";
break;
case 95:
csCharPattern = "nwwnnwwnnn";
break;
case 96:
csCharPattern = "nnwwnwwnnn";
break;
case 97:
csCharPattern = "nnwnnnwwnw";
break;
case 98:
csCharPattern = "nwwnnnwwnn";
break;
case 99:
csCharPattern = "nnwwnnwwnn";
break;
}
return csCharPattern;
}

28
Barcode/I2of5.h Normal file
View File

@@ -0,0 +1,28 @@
// I2of5.h: interface for the CI2of5 class.
//
// Copyright 2002 Neil Van Eps
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_I2OF5_H__B02700B9_DD08_4B2C_B966_47F1275323B4__INCLUDED_)
#define AFX_I2OF5_H__B02700B9_DD08_4B2C_B966_47F1275323B4__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Barcode.h"
class CI2of5 : public CBarcode
{
public:
void DrawBitmap();
CI2of5();
virtual ~CI2of5();
private:
CString RetrievePattern(int nTwoDigitNumber);
void DrawPattern(CString csCharPattern);
};
#endif // !defined(AFX_I2OF5_H__B02700B9_DD08_4B2C_B966_47F1275323B4__INCLUDED_)

176
Barcode/RationalCodabar.cpp Normal file
View File

@@ -0,0 +1,176 @@
// RationalCodabar.cpp: implementation of the CRationalCodabar class.
//
// Copyright 2002 Neil Van Eps
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "RationalCodabar.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CRationalCodabar::CRationalCodabar()
{
// rational codabar
m_nSymbology = RATIONALCODABAR;
}
CRationalCodabar::~CRationalCodabar()
{
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// DrawBitmap()
//
// Description:
// draws a barcode using the previously loaded data
//
// Arguments:
// none
//
// Return:
// void
//
// Called by:
// public class interface
//
////////////////////////////////////////////////////////////////////////////////////
void CRationalCodabar::DrawBitmap()
{
int i;
// draw each character in the message
for (i=0;i<m_csMessage.GetLength();i++)
DrawPattern(RetrievePattern(m_csMessage.GetAt(i)));
return;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// DrawPattern()
//
// Description:
// draws the passed character pattern at the end of the barcode
//
// Arguments:
// CString csPattern - the bar pattern to draw
//
// Return:
// void
//
// Called by:
// CRationalCodabar::DrawBitmap()
//
////////////////////////////////////////////////////////////////////////////////////
void CRationalCodabar::DrawPattern(CString csPattern)
{
int i,nXPixel,nYPixel,nTempWidth;
// initialize X pixel value
nXPixel = m_nStartingXPixel;
for (i=0;i<csPattern.GetLength();i++)
{
// decide if narrow or wide bar
if (csPattern.GetAt(i)=='n')
nTempWidth = m_nNarrowBarPixelWidth;
else
nTempWidth = m_nWideBarPixelWidth;
// X value for loop
for (nXPixel=m_nStartingXPixel;nXPixel<m_nStartingXPixel+nTempWidth;nXPixel++)
{
// Y value for loop
for (nYPixel=m_nStartingYPixel;nYPixel<m_nStartingYPixel+m_nPixelHeight;nYPixel++)
{
// if this is a bar
if (i%2==0)
SetPixelV(m_hDC, nXPixel,nYPixel,COLORBLACK);
else
SetPixelV(m_hDC, nXPixel,nYPixel,COLORWHITE);
}
}
// advance the starting position
m_nStartingXPixel+= nTempWidth;
}
return;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Name:
// RetrievePattern()
//
// Description:
// retrieves the bar pattern for a given character
//
// Arguments:
// char cInputCharacter - the input character to get the bar pattern for
//
// Return:
// CString - the bar pattern for the input character
//
// Called by:
// CRationalCodabar::DrawBitmap()
//
////////////////////////////////////////////////////////////////////////////////////
CString CRationalCodabar::RetrievePattern(char c)
{
CString csCharPattern;
if (c == '0')
csCharPattern = "nnnnnwwn";
else if (c == '1')
csCharPattern = "nnnnwwnn";
else if (c == '2')
csCharPattern = "nnnwnnwn";
else if (c == '3')
csCharPattern = "wwnnnnnn";
else if (c == '4')
csCharPattern = "nnwnnwnn";
else if (c == '5')
csCharPattern = "wnnnnwnn";
else if (c == '6')
csCharPattern = "nwnnnnwn";
else if (c == '7')
csCharPattern = "nwnnwnnn";
else if (c == '8')
csCharPattern = "nwwnnnnn";
else if (c == '9')
csCharPattern = "wnnwnnnn";
else if (c == '-')
csCharPattern = "nnnwwnnn";
else if (c == '$')
csCharPattern = "nnwwnnnn";
else if (c == ':')
csCharPattern = "wnnnwnwn";
else if (c == '/')
csCharPattern = "wnwnnnwn";
else if (c == '.')
csCharPattern = "wnwnwnnn";
else if (c == '+')
csCharPattern = "nnwnwnwn";
else if (c == 'A')
csCharPattern = "nnwwnwnn";
else if (c == 'B')
csCharPattern = "nwnwnnwn";
else if (c == 'C')
csCharPattern = "nnnwnwwn";
else if (c == 'D')
csCharPattern = "nnnwwwnn";
return csCharPattern;
}

28
Barcode/RationalCodabar.h Normal file
View File

@@ -0,0 +1,28 @@
// RationalCodabar.h: interface for the CRationalCodabar class.
//
// Copyright 2002 Neil Van Eps
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_RATIONALCODABAR_H__FDB6DE66_1A22_4654_BF67_C6C7B0D16413__INCLUDED_)
#define AFX_RATIONALCODABAR_H__FDB6DE66_1A22_4654_BF67_C6C7B0D16413__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Barcode.h"
class CRationalCodabar : public CBarcode
{
public:
void DrawBitmap();
CRationalCodabar();
virtual ~CRationalCodabar();
private:
CString RetrievePattern(char c);
void DrawPattern(CString csPattern);
};
#endif // !defined(AFX_RATIONALCODABAR_H__FDB6DE66_1A22_4654_BF67_C6C7B0D16413__INCLUDED_)

6
Barcode/StdAfx.cpp Normal file
View File

@@ -0,0 +1,6 @@
// stdafx.cpp : source file that includes just the standard includes
// BBLIB.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

32
Barcode/StdAfx.h Normal file
View File

@@ -0,0 +1,32 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__C75462E8_4711_11D6_880A_00104B2B0208__INCLUDED_)
#define AFX_STDAFX_H__C75462E8_4711_11D6_880A_00104B2B0208__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <atlbase.h>
#include <atlcom.h>
using namespace ATL;
// [JGL] added manually
#include <atltypes.h>
#include "atlstr.h"
#include "atlrx.h"
// TODO: reference additional headers your program requires here
#include "bblib.h"
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__C75462E8_4711_11D6_880A_00104B2B0208__INCLUDED_)

21
Barcode/bblib.h Normal file
View File

@@ -0,0 +1,21 @@
// bblib.h
// must put build number define on third line
#define BUILDNUM 7
//
//
// Copyright 2002 Neil Van Eps
//
enum Symbology
{
RATIONALCODABAR,
TRADITIONALCODABAR,
I2OF5,
CODE39,
COD128,
UPCEAN,
CODE93
};
#define COLORWHITE 0x00FFFFFF
#define COLORBLACK 0x00000000

363
Barcode/bblib.vcproj Normal file
View File

@@ -0,0 +1,363 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="bblib"
ProjectGUID="{0E49D578-377F-4C07-8339-8737AA9FA0EC}"
Keyword="MFCProj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\..\Release"
IntermediateDirectory=".\Release"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
TreatWChar_tAsBuiltInType="false"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Release/bblib.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)\$(ProjectName).lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\..\Release/bblib.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\..\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Debug/bblib.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)\$(ProjectName).lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\..\Debug/bblib.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="Barcode.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="Code128.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="Code39.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="Code93.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="I2of5.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="RationalCodabar.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="StdAfx.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="Barcode.h"
>
</File>
<File
RelativePath="bblib.h"
>
</File>
<File
RelativePath="Code128.h"
>
</File>
<File
RelativePath="Code39.h"
>
</File>
<File
RelativePath="Code93.h"
>
</File>
<File
RelativePath="I2of5.h"
>
</File>
<File
RelativePath="RationalCodabar.h"
>
</File>
<File
RelativePath="StdAfx.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -310,6 +310,28 @@ interface IImageConvert : IDispatch{
[propget, id(4), helpstring("property Width")] HRESULT Width([out, retval] LONG* pVal);
[propput, id(4), helpstring("property Width")] HRESULT Width([in] LONG newVal);
};
[
object,
uuid(634F98FE-270A-4777-9E8F-2B03EF551406),
dual,
nonextensible,
helpstring("IBarcode Interface"),
pointer_default(unique)
]
interface IBarcode : IDispatch{
[propget, id(1), helpstring("property Text")] HRESULT Text([out, retval] BSTR* pVal);
[propput, id(1), helpstring("property Text")] HRESULT Text([in] BSTR newVal);
[propget, id(3), helpstring("property Height")] HRESULT Height([out, retval] ULONG* pVal);
[propput, id(3), helpstring("property Height")] HRESULT Height([in] ULONG newVal);
[id(6), helpstring("method GetAsPNG3")] HRESULT GetAsPNG([out,retval] VARIANT* ImageData);
[propget, id(7), helpstring("property Narrow")] HRESULT Narrow([out, retval] ULONG* pVal);
[propput, id(7), helpstring("property Narrow")] HRESULT Narrow([in] ULONG newVal);
[propget, id(8), helpstring("property Wide")] HRESULT Wide([out, retval] ULONG* pVal);
[propput, id(8), helpstring("property Wide")] HRESULT Wide([in] ULONG newVal);
[propget, id(9), helpstring("property Width")] HRESULT Width([out, retval] ULONG* pVal);
[propget, id(10), helpstring("property Rotation")] HRESULT Rotation([out, retval] LONG* pVal);
[propput, id(10), helpstring("property Rotation")] HRESULT Rotation([in] LONG newVal);
};
[
uuid(B6FCDE6E-141C-4601-B3AC-4DF4D5F25DF8),
version(1.0),
@@ -445,4 +467,12 @@ library SLNKDWFLib
{
[default] interface IImageConvert;
};
[
uuid(8F88E68B-0554-417B-B77E-A7EB55FEC302),
helpstring("Barcode Class")
]
coclass Barcode
{
[default] interface IBarcode;
};
};

View File

@@ -80,7 +80,7 @@
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
AdditionalDependencies="..\SlnkdwfImpl\DebugRW\SLNKDWFStaticRW.lib Secur32.lib"
AdditionalDependencies="..\SlnkdwfImpl\DebugRW\SLNKDWFStaticRW.lib Secur32.lib ..\debug\bblib.lib"
OutputFile="d:\SLNKDWF.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="d:\Library\Dwf702\develop\global\lib\static\debug\vc8.0"
@@ -191,7 +191,7 @@
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
AdditionalDependencies="..\SlnkdwfImpl\ReleaseRW\SLNKDWFStaticRW.lib Secur32.lib"
AdditionalDependencies="..\SlnkdwfImpl\ReleaseRW\SLNKDWFStaticRW.lib Secur32.lib ..\release\bblib.lib"
OutputFile="D:\SLNKDWF.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="d:\library\Dwf702\develop\global\lib\static\release\vc8.0;.\CxImage\"
@@ -243,6 +243,10 @@
RelativePath="About.cpp"
>
</File>
<File
RelativePath=".\Barcode.cpp"
>
</File>
<File
RelativePath="BoundingBox.cpp"
>
@@ -385,6 +389,10 @@
RelativePath="ASPObject.rgs"
>
</File>
<File
RelativePath=".\Barcode.h"
>
</File>
<File
RelativePath="BoundingBox.h"
>
@@ -501,10 +509,18 @@
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
<File
RelativePath=".\Barcode.rgs"
>
</File>
<File
RelativePath="DWFFile.rgs"
>
</File>
<File
RelativePath=".\ImageConvert.rgs"
>
</File>
<File
RelativePath=".\ImageConvert2.rgs"
>

View File

@@ -1,6 +1,6 @@
// Zorg dat versies alfabetisch altijd op elkaar volgen!
#define SLNK_MAJOR_VERSION 2
#define SLNK_MINOR_VERSION 41
#define SLNK_MINOR_VERSION 50
#define SLNK_BUILD_VERSION 0
// Define resource strings

View File

@@ -138,7 +138,7 @@ IDR_OPTIONS REGISTRY "Options.rgs"
IDR_ZIP REGISTRY "Zip.rgs"
IDR_WHIPCLEANER REGISTRY "WhipCleaner.rgs"
IDR_IMAGECONVERT REGISTRY "ImageConvert.rgs"
IDR_BARCODE REGISTRY "Barcode.rgs"
#endif // Dutch (Netherlands) resources
/////////////////////////////////////////////////////////////////////////////

View File

@@ -28,6 +28,7 @@
#define IDR_ZIP 128
#define IDR_WHIPCLEANER 129
#define IDR_IMAGECONVERT 130
#define IDR_BARCODE 131
// Next default values for new objects
//
@@ -36,6 +37,6 @@
#define _APS_NEXT_RESOURCE_VALUE 201
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
#define _APS_NEXT_SYMED_VALUE 131
#define _APS_NEXT_SYMED_VALUE 132
#endif
#endif