About Npcp; Npcp Driver Installation And Removal; Opening The Npcp Driver - Intermec CN2B User Manual

Mobile computer
Hide thumbs Also See for CN2B:
Table of Contents

Advertisement

About NPCP

NPCP Driver Installation and Removal

Install()
{
HANDLE hDevice;
TCHAR port[6];
port[0] = TCHAR('C');
port[1] = TCHAR('O');
port[2] = TCHAR('M');
port[3] = TCHAR('1');
port[4] = TCHAR(':');
port[5] = TCHAR(0);
hDevice = RegisterDevice ( (TEXT("LPT"), 9,
TEXT("\\STORAGE CARD\\WINDOWS\\NPCPPORT.dll"), (DWORD)port);
}

Opening the NPCP Driver

CN2B Mobile Computer User's Manual
Operations to upgrade printer modules, perform printer diagnostics, and
get printer configuration are performed largely via DeviceIOControl()
functions.
®
NPCP (Norand
Portable Communications Protocol) is a proprietary pro-
tocol that provides session, network, and datalink services for Intermec
mobile computers in the Intermec LAN environment used with printers
and data communications.
Use LPT9: for the NPCP printer device and COM1 for the last parameter.
COM1 is the connection available via the CN2B Computer.
Applications use the RegisterDevice() function to install the driver. Dereg-
isterDevice() uninstalls the device driver and frees memory space when the
driver is not required. Use the HANDLE returned by RegisterDevice() as
the parameter to DeregisterDevice().
Use the RegisterDevice() function call as demonstrated below. Specify the
full path name to the driver starting at the root for the RegisterDevice()
function to work properly. The last parameter to RegisterDevice() is a
DWORD that represents the name of the port for the NPCP stream driver
to use. Build this parameter on the stack if it is not to be paged out during
the call. The first parameter "LPT" (Device Name) and the second parame-
ter "9" (index), indicate the name of the registered device, such as LPT9.
This is used in the CreateFile() function call.
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);
Chapter 5 — Printer Support
111

Advertisement

Table of Contents
loading

Table of Contents