Article View: comp.os.os2.programmer.misc
Article #187Device Monitor Programming
From: Keith Bennett
Date: Sun, 23 Apr 1995 00:00
Date: Sun, 23 Apr 1995 00:00
48 lines
2756 bytes
2756 bytes
This question pertains to the use of device monitors used to intercept and divert printer output. We have a small program that intercepts, reads, and processes printer (LPT1) output. A coworker copied the code from a sample from a book or magazine and adapted it for our use. I have extracted the device monitor code from the program and created a class that can be easily used by other programs. However, I'm having some problems with it and have several questions. The code contains functions whose names contain 16: APIRET16 APIENTRY16 Dos16MonOpen(PSZ,PHFILE16); APIRET16 APIENTRY16 Dos16MonClose(HFILE16); APIRET16 APIENTRY16 Dos16MonReg(HFILE16,PUCHAR,PUCHAR,USHORT,USHORT); APIRET16 APIENTRY16 Dos16MonRead(PUCHAR,USHORT,PMONITORPACKET,PUSHORT); APIRET16 APIENTRY16 Dos16MonWrite(PUCHAR,PMONITORPACKET,PUSHORT); In PRCP.INF (dated 11/16/90), the functions are listed there but their names do not include "16". Is this because the "16" was added for clarity after 32 bit libraries became available? These prototypes must explicitly be inserted in the source code, as they are nowhere to be found in the compiler and toolkit header files. I am told that this is because the use of them is discouraged. Nevertheless they exist in the libraries, and linking succeeds. We are currently using OS/2 2.1, but intend to upgrade to Warp. Are these functions present in Warp? Why is use of these functions discouraged? Are there other better ways to accomplish what we need to do? The reason we need to use a printer monitor is this: We need to receive data from a mainframe. Using Comm Mgr, we can tell the mainframe that we have a printer connected to LPT1. Then the mainframe "prints" to it. We intercept the data and process it. My understanding is that this approach was used to minimize or eliminate software development on the mainframe side. Any illumination would be greatly appreciated. - Keith -- -------------------------------------------------------------------------- Keith Bennett Bennett Business Solutions, Inc. Silver Spring, MD USA OS/2 & DOS Software Development kbennett@cpcug.org (301) 871-7696
Technical Details
Message-ID:
<3nef9c$580@cpcug.org>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11307a,48328ebe0e8e15d6,start X-Google-Attributes: gid11307a,public X-Google-Thread: 10cd94,48328ebe0e8e15d6,start X-Google-Attributes: gid10cd94,public From: kbennett@cpcug.org (Keith Bennett) Subject: Device Monitor Programming Date: 1995/04/23 Message-ID: <3nef9c$580@cpcug.org> X-Deja-AN: 101229756 organization: Express Access Online Communications USA: 800-969-9090 newsgroups: comp.os.os2.programmer.misc,bit.listserv.os2-l