User's Manual Part 1

Table Of Contents
Scanner SupportChapter 6
140 700 Series Color Mobile Computer User’s Manual
How to Create and Use the ADC COM Interfaces
You can also use the Input Device Functions (starting on page 149) to
create and use the ADC COM interfaces.
1 Create and initialize the in-process Bar Code Reader object using
ITCDeviceOpen() (see page 149). This function returns a COM
Interface pointer to the Bar Code Reader Object created by the
function.
2 Set the data grid if data filtering is desired (default grid gives the applica-
tion all the data). Below is a sample code of how to set the grid to accept
Code 39 data that starts with the letter “A” and is not a reader com-
mand.
ITC_BARCODEREADER_GRID stBCGrid;
stBCGrid.stDIGrid.szDataMask = TEXT(”A%s”);
stBCGrid.stDDGrid.dwSymbologyMask = BARCODE_SYMBOLOGY_CODE39;
stBCGrid.dwDataSourceTypeMask = ITC_DATASOURCE_USERINPUT;
HRESULT hrStatus = pIBCControl->SetAttribute(
ITC_RDRATTR_GRID,
reinterpret_cast<BYTE *>(&stBCGrid),
sizeof(stBCGrid)
);
3 Issue a read to accept the bar code data. The timestamp, symbology, and
data type are put into the ITC_BARCODE_DATA_DETAILS struc-
ture. Passing in a pointer to this structure is optional. The following
sample code uses an infinite timeout.
ITC_BARCODE_DATA_DETAILS stBCDetails;
BYTE rgbBCData[1024]; // Buffer used to accept the bar code data
DWORD dwBytesReceived; // Number of bytes in the return data.
HRESULT hrStatus = pIBCControl->Read(
rgbBCData,
sizeof(rgbBCData),
&dwBytesReceived,
& stBCDetails,
INFINITE
);
4 Compile and link the application.
Read-Ahead Bar Code Data Access
The Bar Code Reader COM object delivers ADC data to the connection
in read-ahead mode. In this mode, the data is queued until a COM con-
nection is ready to read it. Read-ahead mode decouples reader device per-
formance from the application performance. That is, data is read as fast as
the user can scan it, independent of the connection processing load. No
data w ill be scanned until the first Read() function is posted.