Calls to BarInfo with an integer value specifying the barcode type in itype will return bc containing information about that type, including its abbreviated name, nominal length and height (if any), required number of characters (if restricted), check digit (or parity) requirements, alphabetic character support, and whether the code supports or requires a subscript (or supplementary code).
BarInfo return the value of itype for code types that it can process; otherwise it returns -1.
Thus to fill a list box with the names of available code types the following sample code may be used:
for (i=0; (BarInfo(hInstance,i,&bc)>=0);
i++){
SendDlgItemMessage(hDlg,IDD_TYPE,CB_ADDSTRING,0,(LONG)(LPSTR)bc.name);
}
When a specific code type has been chosen a BARCODE structure may be filled with information about the code using
bc.code=n;
BarInfo(hInstance,bc.code,&bc);
bc.req_number now contains the number of characters required for the primary code, bc.subscript contains the number required for any supplementary, bc.parity is 1 if the code type supports a check digit, etc.
int WINAPI BarInfo(HMODULE hInstance, int itype,LPBAR bc)
where
hInstance is the instance handle of the calling application. (May be 0)
itype is the barcode type index (0-27), and
bc is a long pointer to a BARCODE structure.
More: