O'neil Printer Driver; Dtr Driver Installation And Removal; Opening The Dtr Driver - Intermec CN2B User Manual

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

Advertisement

O'Neil Printer Driver

DTR 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("DTR"), 1, TEXT("\\WINDOWS\\ONEIL.DLL"),
(DWORD)port);
}

Opening the DTR Driver

CN2B Mobile Computer User's Manual
The DTR printer communications driver is a Stream Device Driver named
ONEIL.DLL.
All applications use WIN32 API functions to access drivers. Basic opera-
tions are easily implemented by applications through the CreateFile(),
WriteFile(), DeviceIOControl() and CloseHandle() Win32 APIs.
The driver supports communications to PB20, PB40, and PB42 printers
over a selected serial port.
Your application must install the device driver by using the RegisterDe-
vice() function. The driver name is ONEIL.DLL. We recommend that you
use "DTR" for the Device Name parameter, "1" for the Device Driver
index parameter, and use any of the following strings for the last parameter:
• NULL (==0) Defaults to COM1 @ 9600
• "COM1" only COM port specified defaults to 9600
• "COM1:9600" sets to COM port and specified bit rate
• "COM1:19200" sets to COM port and specified bit rate
Use the HANDLE returned by RegisterDevice() as the parameter to Dereg-
isterDevice(). The correct usage of the RegisterDevice() function call is
demonstrated below. You may use DeregisterDevice() to uninstall the
driver.
The application opens the DTR driver by using the CreateFile() function.
The call can be implemented as follows:
hFile = CreateFile(_T("DTR1:"), GENERIC_WRITE, 0, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
Chapter 5 — Printer Support
115

Advertisement

Table of Contents
loading

Table of Contents