Denso BHT-700-CE Reference Manual page 101

Barcode handy terminal
Table of Contents

Advertisement

When dwCDType is P (MSI), the length of barcode data must be two or more digits. If not, this function
gets "0" and returns an error code. To calculate a two-digit CD, call this function twice.
To check whether the CD is correct: Pass a CD-suffixed barcode data to the BHT_GetBarChkDgt
function as shown below. If the returned value is equal to the CD, the CD data is suitable for the
barcode data.
[Ex]
BHT_GetBarChkDgt(TEXT("123456782"), 'P', &dwChkDgt);
if (dwChkDgt == '2' ) {
printf("CD OK");
}
To add a CD to barcode data: Pass barcode data followed by a dummy character to the
BHT_GetBarChkDgt function as shown below. The returned value will become the CD to be replaced
with the dummy character.
[Ex]
wcscpy(wchBarData, TEXT("12345678"));
wcscpy(wchBarData1, wchBarData);
wcscat(wchBarData1, TEXT("0"));
BHT_GetBarChkDgt(wchBarData1, 'P', &dwChkDgt);
wprintf(TEXT("%s%c"), wchBarData, dwChkDgt);
Result
> CD = 123456782
96

Advertisement

Table of Contents
loading

Table of Contents