TBarCode Library 11  TBarCode Library 11
ERRCODE _stdcall BCSetTextA ( t_BarCode pBarCode,
LPCSTR  szText,
LONG  nLen 
)

Sets the barcode data (ASCII version).

This function applies the input data to the barcode. The input data is also often called "utilisable data". The set of allowed characters depends on the selected barcode type. Some barcode types support alphanumeric or even binary characters, others only numeric. Some types require a specific data length, others do not. If the input data is invalid for the currently selected barcode type, an error code <> 0 is returned.
Please examine the Barcode Reference (https://www.tec-it.com/documentation) to be informed about the data format of the bar codes supported by TEC-IT.

Note:
Please make sure that you set up all barcode parameters (like barcode type, translation of escape sequences, etc.) before assigning the barcode data. Otherwise the input data will not be converted to the target character set correctly.
Encoding (ANSI / UNICODE):
The user can either pass ANSI encoded data by calling BCSetTextA or UNICODE encoded data via BCSetTextW.
The ANSI-encoded data consists of single byte characters and must correspond to Windows or IBM CodePage 1252, which is a special variety of Latin-1.
/par On Windows systems UNICODE data is UTF-16 encoded, on AIX the encoding is UCS-2. Both are 2-byte encodings. On other Linux and UNIX system UCS-4, a 4-byte encoding, is used instead.
See also:
BCGetText(), BCSetTextA(), BCSetTextW(), BCIsTextUnicode(), BCGetTextLen()
Parameters:
[in]pBarCodePointer to barcode structure.
[in]szTextBar-code text.
[in]nLenLength of input string.
  • >0: Length of string is specified in nLen
  • 0: TBarCode expects a \0-terminated string
Return values:
ERRCODEErrOk (0) in case of success. Non-zero if error occurred.