home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / msdos / programm / 9349 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  2.5 KB

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