Data Structure

The dBarcode DLL uses a single data structure for transferring data into the library routines, BARCODE, which is defined in DLSBAR34.H along with a long pointer to the structure LPBAR.

 

typedef struct tagBARCODE
          {
          int                code;
          char             name[16];
          int                show_text;
          int                auto_parity;

          int                orientation;
          int                show_checkdigit;

          int                nominal_size;

          int                line_reduction;

          int                border_thickness;

          COLORREF     fore_color;

          COLORREF     back_color;

          int                error;
          char                       string[84];
          int                req_number;

          int                parity;
          int                alphabetic;

          int                length;

          int                height;

          int                subscript;

          int                flags;

          int                textgap;
          char             string2
[84];
          int                bearer_size;

          int                spare;

          int                xunit;

          int                bearerthick;
          int                margin_size;

          int                barratio;

          int                charspacing;

          int                justification;

} BARCODE;

typedef BARCODE far *LPBAR;

 

A BARCODE structure must exist before any barcode-creating library routines are called, so your program requires a declaration such as

BARCODE bc;

to appear in the program before any calls are made to the library routines.

Some members of the Barcode structure must be filled before any calls are made to the library routines. Other members of the structure are used for returning information to the calling application and so do not require filling prior to library calls.

Visual Basic callers use a slightly different structure definition, in which either strings of byte arrays may be defined. When byte arrays are used the length allowed for data is reduced by 4 bytes to allow for the array header, ie.

 

Private Type BARCODE
    code As Long
    name1(12) As Byte
    show_text  As Long
    auto_parity  As Long
    orient  As Long
    show_checkdigit  As Long
    nominal_size  As Long
    line_reduction  As Long
    border_thickness  As Long
    fore_color As Long
    back_color As Long
    ierror  As Long
    string1(80) As Byte
    req_number  As Long
    parity  As Long
    alphabetic  As Long
    length  As Long
    Height  As Long
    subscript  As Long
    flags  As Long
    textgap  As Long
    string2(80) As Byte
    bearer_size  As Long
    spare  As Long
    xunit As Long
    bxx As Long
    margin_size As Long
    barratio As Long
    charspacing As Long
    justification As Long
    End Type

 

More:

Group 1 Library calls