Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing direct to printer

Status
Not open for further replies.

jones172

Programmer
Jul 20, 2002
5
US
Dear Users,

I want to write directly to the printer, in case there is an infinite loop. To do this, I want to define a pointer

fp = fopen ("something_or_other", "w");

Question: What is the "something_or_other"? lpt doesn't seem to work, nor does lpt:, nor does lpt1: I am using Borland Turbo C and writing to a DOS prompt under Win 95.
Help appreciated.

Thomas Jones
DrJones@alum.MIT.edu
 
fopen won't work on Win95 for devices. Have a look at
Basically it is for serial comms. All you need to do is to replace com1 with lpt1. You will need to #include <windows.h>. I know it is a DOS application you are working on but you will need <windows.h> for the prototypes of CreateFile, WriteFile and CloseHandle.
 
i don't know 'window', you should be able
to do this using 'popen()', see also my
sample-code in thread205-336551 (sending mail) change mail by the appropriate print
command.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top