Denso BHT-700-CE Reference Manual page 99

Barcode handy terminal
Table of Contents

Advertisement

When dwCDType is N (Codabar), the length of barcode data must be three digits or more including
start and stop characters. If not, this function gets "0" and returns an error code.
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("a0123-a"), 'M', &dwChkDgt);
if ( dwChkDgt == '-' ) {
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("a0123a"));
len = wcslen(wchBarData);
wcsncpy(wchTmp1BarData, wchBarData, len – 1);
wcscpy(wchTmp2BarData, wchTmp1BarData);
wcscat(wchTmp2BarData, TEXT("0"));
wcscat(wchTmp2BarData, &(wchBarData[len – 1]));
BHT_GetBarChkDgt(wchTmp2BarData) 'M', &dwChkDgt);
wprintf(TEXT("%s%c%s"), wchTmp1BarData, dwChkDgt, &wchTmp2BarData[len-1]));
Result
> CD = a0123-a
94

Advertisement

Table of Contents
loading

Table of Contents