home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.os.msdos.programmer:9349 comp.sys.ibm.pc.misc:12628
- Path: sparky!uunet!mcsun!Germany.EU.net!sbsvax!coli-gate.coli.uni-sb.de!sbustd!chbl
- From: chbl@sbustd.rz.uni-sb.de (Christian Blum)
- Newsgroups: comp.os.msdos.programmer,comp.sys.ibm.pc.misc
- Subject: Re: Can I Intercept Stuff Going To A Printer Into A file.??
- Message-ID: <1992Sep14.155031.19164@coli.uni-sb.de>
- Date: 14 Sep 92 15:50:31 GMT
- References: <1992Sep10.023143.1711@cbnewse.cb.att.com>
- Sender: news@coli.uni-sb.de (Usenet news system)
- Organization: Studenten-Mail, Rechenzentrum Universitaet des Saarlandes
- Lines: 42
-
- hjanssen@cbnewse.cb.att.com (hank janssen) writes:
- > For all you MSDOS wizards out there. Maybe a stupid question.
- > I have an application that prints out data from a very old DB system.
- > I need to get the output of a list from the database in a flat file.
- > (THe database is very old, and i have no DB access routines)
- >
- > I can print pre-made lists. But they always go to the printer.
- > Is there aneasy way for me to intercept the stuff going to the printer
- > and route it to go to a file.
- >
- > The program directly prints to the printer port.
-
- Depends highly on how the program accesses the printer port. If it
- uses API interrupt 17h, it is possible (but tricky). If it writes
- directly to the printer port... bad luck. If it uses the appropriate
- DOS handle, it's quite easy.
-
- To intercept INT 17h using a TSR program is rather easy, but writing
- the characters to a file isn't, because DOS is not reentrant. Best
- write the characters into a buffer, then quit the application and
- write the data to a file.
-
- If the program uses the DOS printer handle, simply close it and re-open it
- with function 3Ch. Then call the application as a child program
- via function 4Bh (?, look it up in R. Brown's list).
-
- Both ways require a certain level of experience in assembler
- programming.
-
- --
- ---------------------------------------------------------------------
- Christian Blum Universitaet des Saarlandes, Germany
- Friedrich-Ebert-Str. 50 chbl@stud.uni-sb.de
- W-6685 Heiligenwald chbl@sbustd.rz.uni-sb.de
- Germany
-
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
- $$ $$
- $$ Bottom-up is a design method that consists of transforming $$
- $$ a lot of small problems into a big one. $$
- $$ $$
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
-