Opening The Npcp Driver; Closing The Npcp Driver; Reading From The Npcp Driver; Writing To The Npcp Driver - Intermec 700 Series User Manual

Color mobile computer
Hide thumbs Also See for 700 Series:
Table of Contents

Advertisement

SECTION 5

Opening the NPCP Driver

The application opens the NPCP driver by using the CreateFile() function. The
call can be implemented as follows. The first parameter "LPT9:" must reflect the
device name and index used in the RegisterDevice() function call and will fail for
any of the following reasons:
hFile = CreateFile(_T("LPT9:"), GENERIC_WRITE | GENERIC_READ, 0, NULL, OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
"
"
"
"

Closing the NPCP Driver

Using the CloseHandle() (hFile) function closes the NPCP driver. Where hFile is
the handle returned by the CreateFile() function call.
"
"

Reading from the NPCP Driver

Reading of the NPCP printers is not supported since all responses from the
printer are the result of commands sent to the printer. DeviceIoControl()
functions are provided where data is to be received from the printer.

Writing to the NPCP Driver

All Print data can be sent to the printer using the WriteFile() function. The print
data written to the driver must contain the proper printer commands for
formatting. If the function returns FALSE, the NPCP error may be retrieved
using IOCTL_NPCP_ERROR. See the description on the next page.
The port associated with the device during RegisterDevice() is in use.
The NPCP device is already open.
The share mode is not set to zero. The device cannot be shared.
Access permissions are not set to GENERIC_WRITE | GENERIC_READ.
Both modes must be specified.
TRUE = the device is successfully closed.
FALSE = an attempt to close NULL HANDLE or an already closed device.
700 Series Color Mobile Computer User's Manual
Printer Support
5-3

Advertisement

Table of Contents
loading

Table of Contents