Contents

Properties

Events

Functions


Events

Changed

Resized

Click

DblClick

DragDrop

DragOver

LinkClose

LinkError

LinkNotify

LinkOpen

MouseDown

MouseMove

MouseUp


Properties

BarCodeType

Checksum

Rotation

Text

NarrowBarWidth

Ratio

ChecksumString


Functions

BarCodePrint

BarCodeGetLastErrorCode

BarCodeGetLastErrorString

BarCodeGetLastErrorStringC


Changed

This event is fired when the text property is changed.


Resized

This event is fired when the size of the barcode is changed. BarCode/VBX will automatically resize the conatiner in order to display the entire barcode. This event can be useful if you need to reposition other objects on your form based on the size of the barcode.


Click

This event is fired when the user clicks the left mouse button. This is a standard event, see the Visual Basic users manual for more information.


Double Click
DblClick

This event is fired when the user double clicks the left mouse button. This is a standard event, see the Visual Basic users manual for more information.


DragDrop

This event is fired when the control is the target of a drop operation. This is a standard event, see the Visual Basic users manual for more information.


DragOver

This event is fired when the control is the target of a drop operation. This is a standard event, see the Visual Basic users manual for more information.


LinkClose

This event is fired when a DDE conversation is terminated. This is a standard event, see the Visual Basic users manual for more information.


LinkOpen

This event is fired when a DDE conversation is initiated. This is a standard event, see the Visual Basic users manual for more information.


LinkError

This event is fired when a DDE error occurs. This is a standard event, see the Visual Basic users manual for more information.


LinkNotify

This event is fired when a DDE conversation has been initiated and the data in the server has changed. This is a standard event, see the Visual Basic users manual for more information.


MouseDown

Fired when a mouse button is pressed. The mouse is captured as a result of this event. This is a standard event, see the Visual Basic users manual for more information.


MouseMove

Fired when mouse movement occurs. This is a standard event, see the Visual Basic users manual for more information.


MouseUp

Fired when a mouse button is released. The mouse capture is released as a result of this event. This is a standard event, see the Visual Basic users manual for more information.


BarCodeType
BarCodeType Property

Code 3 of 9

Extended Code 3 of 9

Interleaved 2 of 5

Code 93

Extended Code 93

UPCA

UPCE 10 digit

UPCE0 6 digit

UPCE1 6 digit

EAN 13

EAN 8

Code 128 Auto

Code 128 A

Code 128 B

Code 128 C

Codabar

MSI Plessey

UCC-128

POSTNET (Zip + 4 PostalCode)


Checksum
Checksum Property

Checksums can be optionally added to some barcodes. See the description on the particular bar code type for more information.


Rotation
Rotation Property

The bar code can be rotated by setting this property to the proper value. The following shows the different orientations:


Text
Text Property

The text property allows you to set the text that will be used to generate the bar code itself. If you are in design mode, changing this property will cause the BarCode/VBX to draw the barcode, if the text entered is valid for the bar code type that is currently selected.


Narrow Bar Width
Narrow Bar Width Property

This property controls the width of the narrow bars, in dots. BarCode/VBX defaults to 2 dots, which means that the narrow bars in each bar code will be two dots wide. Use this property to change the width of the narrow bars. Valid ranges are from 1 thru 6.


Ratio

The ratio of the wide bars to narrow bars can be controlled using this property. BarCode/VBX defaults to a 3:1 ratio. Valid selections for this property are:

0 =    3:1

1 = 2.5:1

2 =    2:1


ChecksumString

This property is a string that contains the value of the checksum character. This property is read-only at run time and not available at design time.


Code3 of 9

This bar code is an alphanumeric bar code allowing uppercase letters and numbers. BarCode/VBX will convert any lower case letters into upper case before printing the bar code. Each character consists of nine elements. 3 of the nine elements are wide, hence the name '3 of 9'.

Set the checksum property to a non-zero value to add a checksum to the barcode.


Extended 3 of 9

Extended 3 of nine is similar to Code 3 of 9 except that it allows the full 128 ASCII character set to be encoded by printing two bar code characters for each text character.

Set the checksum property to a non-zero value to add a checksum to the barcode.


Interleaved 2 of 5

This is strictly a numeric bar code. Each encoded character is made up of five elements, two are wide and three are narrow. The number of characters to be printed must be an even number. If the number of characters to be printed is odd a zero will be appended to the beginning of the code.

Set the checksum property to a non-zero value to add a checksum to the barcode.


Code 93

Code 93 is an alpha-numeric bar code allowing upper case letters and numbers. BarCode/VBX will convert lower case letters to upper case before encoding them.

Set the checksum property to a non-zero value to add a checksum to the barcode.


Extended Code 93

Extended Code 93 is similar to Code 93 except that it allows the full 128 character ASCII character set to be encoded.

Set the checksum property to a non-zero value to add a checksum to the barcode.


UPCA

UPC (Universal Product Code) version A is used to encode an 11 digit number. The first digit is the system number and the rest are data characters. Both 2 and 5 digit supplementals are also supported.

The value of the checksum property is not used.


UPCE 10 digit

UPCE is a zero suppressed version of the UPCA barcode. This version allows 10 digits to be encoded. The first digit must be zero. Both 2 and 5 digit supplementals are also supported.

The value of the checksum property is not used.


UPCE0 6 digit

UPCE is a zero suppressed version of the UPCA barcode. This version allows 6 digits to be encoded. The first digit must be zero. Both 2 and 5 digit supplementals are also supported.

The value of the checksum property is not used.


UPCE1 6 digit

UPCE is a zero suppressed version of the UPCA barcode. This version allows 6 digits to be encoded. The first digit must be zero. Both 2 and 5 digit supplementals are also supported.

The value of the checksum property is not used.


EAN 13

EAN barcodes are used when the country origin needs to be known. There are 13 digits in EAN 13 where the first two characters are used to define the country of origin,. the next ten are data, followed by the checksum. Both 2 and 5 digit supplementals are also supported.

The value of the checksum property is not used.


EAN 8

EAN barcodes are used when the country origin needs to be known. There are 8 digits in EAN 8 where the first two characters are used to define the country of origin,. the next 5 are data, followed by the checksum. Both 2 and 5 digit supplementals are also supported.

The value of the checksum property is not used.


Code 128 Auto

Code 128 is a variable length bar code that is capable of encoding the entire 128 character ASCII character set. Code 128 allow three subsets, A, B and C. This version, 'Code 128 Auto', will automatically select the subset that will produce the smallest bar code.

Set the checksum property to a non-zero value to add a checksum to the barcode.


Code 128 A

Code 128 is a variable length bar code that is capable of encoding the entire 128 character ASCII character set. Code 128 allow three subsets, A, B and C. This subset (A) allows all standard upper case alpha-numeric keyboard characters plus control characters.

Set the checksum property to a non-zero value to add a checksum to the barcode.


Code 128 B

Code 128 is a variable length bar code that is capable of encoding the entire 128 character ASCII character set. Code 128 allow three subsets, A, B and C. This subset (B) allows all standard upper case alpha-numeric keyboard characters and lower case alpha characters.

Set the checksum property to a non-zero value to add a checksum to the barcode.


Code 128 C

Code 128 is a variable length bar code that is capable of encoding the entire 128 character ASCII character set. Code 128 allow three subsets, A, B and C. This subset (C) includes a set of 100 digit pairs from 00 to 99 inclusive. This allows double density numeric digits, two digits per bar coded character.

Set the checksum property to a non-zero value to add a checksum to the barcode.


Codabar

Codabar is a variable length barcode that can encode 16 data characters including 0-9, plus the symbols - $ ; / . +. Codabar is used primarily for numeric data.

Set the checksum property to a non-zero value to add a checksum to the barcode.


MSI Plessey

This barcode is a variable length barcode that can encode up to 15 numeric digits. Checksum generation is dependent on the value of the checksum parameter. The following table indicates the value of the checksum property and the type of checksum created.

0 = one modulus 10 checksum

1 = two modulus 10 checksums

2 = one modulus 11 checksum/one modulus 10 checksum


UCC-128

This bar code is a specially defined subset of Code 128 that is used mostly on shipping containers. It is numeric only having a fixed length of 19 digits.

Set the checksum property to a non-zero value to add a checksum to the barcode.


POSTNET (Zip + 4 Postal Code)

The POSTNET barcode is used on envelopes and postcards that are sent through the U.S. Postal Service. This barcode is placed in the lower right hand corner of the envelope.

The Checksum, Rotation, and NarrowBarWidth properties have no effect on this bar code.


BarCodePrint
BarCodePrint Function

This function allows you to print a bar code on a device context that you have created before calling this function. Simply obtain a device context for the device that you wish to print on and fill in the members of the BARCODEPRINTDATA structure. The return value of this function is a boolean value that indicates if the function was successful. If the return value is 'False', the function failed. Use the BarCodeGetLastErrorCode or the BarCodeGetLastErrorString functions to retrieve the last error.

This function is declared in the 'BARCODE.BAS' file as:

Declare Function  Lib "BARCODE.VBX" (lpBarCodeData As BARCODEPRINTDATA) As Integer


BARCODEPRINTDATA
BARCODEPRINTDATA Structure

In Visual Basic this structure is defined as:

Type BARCODEPRINTDATA

BarCodeType As Integer

Checksum As Integer

Text As String * 30

Rotation As Integer

NarrowBarWidth As Integer

Ratio As Integer

hDC As Integer

x As Integer

y As Integer

Height As Integer

End Type

In Visual C++ the structure is as follows:

typedef struct tagPrintBarCode {

int BarCodeType;

int Checksum;

Byte Text[30];

int Rotation;

int NarrowBarWidth;

int Ratio;

int hDCPrinter;

int x;

int y;

int Height;

} *LPBARCODEDATA;


BarCodeGetLastErrorCode
BarCodeGetLastErrorCode Function

This function allows you to retrieve the last error code. This function can be used in Visual Basic or Visual C++.

In Visual Basic this function is defined as:

Declare Function GetLastErrorCode Lib "BARCODE.VBX" () As Integer

int BarCodeGetLastErrorCode(void);

This function returns the last error code.

In Visual C++ this function can be called by using the 'Load Library', 'GetProcAddress', and 'FreeLibrary' functions. The following is an example:

HINSTANCE hVBXInst;

int TheLastErrorCode;

int (FAR PASCAL *GetErrorCode) (void) = NULL;

hVBXInst = LoadLibrary("BARCODE.VBX");

GetErrorCode = (int (__far __pascal *)(void))GetProcAddress(hVBXInst,"BarCodeGetLastErrorCode");

if(GetErrorCode != NULL)

TheLastErrorCode = (*GetErrorCode)();

FreeLibrary(hVBXInst);


BarCodeGetLastErrorString
BarCodeGetLastErrorString Function

This function will return a string that describes the last error. This function must not be used in Visual C++ because this function returns a Visual Basic String. See the 'BarCodeGetLastErrorStringC' function.

Declare Function GetLastErrorString Lib "BARCODE.VBX" () As String


BarCodeGetLastErrorStringC
BarCodeGetLastErrorStringC Function

LPSTR BarCodeGetLastErrorStringC(LPSTR Buffer, int BufferLength);

LPSTR Buffer;	/* pointer to buffer that will hold string */

int BufferLength;	/* length of buffer */

This function retrieves the last error string into a buffer. In Visual C++ this function can be called by using the 'Load Library', 'GetProcAddress', and 'FreeLibrary' functions. The following is an example:

HINSTANCE hVBXInst;

char Str[81] = "";

LPSTR (FAR PASCAL *GetErrorStr) (LPSTR, int) = NULL;

GetErrorStr = (char __far *(__far __pascal *)(LPSTR, int))GetProcAddress(hVBXInst,"BarCodeGetLastErrorStringC");

if(GetLastErrorString != NULL)

(*GetErrorStr)((LPSTR)Str, 81);

FreeLibrary(hVBXInst);