kellis
asked on
accessing printer stream in c++ for windows
I've got what's probably a really easy question,
but I can't seem to find an answer in several different
books...can someone tell me how to send a stream to the
printer in borland c++ for windows?
I've tried:
#define printer "LPT1"
and
#define printer "PRN"
even
#define printer "PRN:LPT1"
then
ofstream outf;
outf.open(printer); c++ seems to recognize PRN and LPT1 as valid
outf <<... constants--no errors on run
but output is sent to screen(window).
the text says that stdio.h has a stream called stdprn
and i've tried to use
fprintf(stdprn,"this is a test");
just to try that, and it goes to screen also.
The least capability I need is to be able to create a file then
print hard copy from within the program...I would like to be able
to send individual lines to printer for headers or summary that I
don't want in the actual file.
Pardon me if I've missed something obvious.....
BTW this is windows 3.11 and borland c++4.52 (I also have turboc++3.1)
thanks in advance
kevin
but I can't seem to find an answer in several different
books...can someone tell me how to send a stream to the
printer in borland c++ for windows?
I've tried:
#define printer "LPT1"
and
#define printer "PRN"
even
#define printer "PRN:LPT1"
then
ofstream outf;
outf.open(printer); c++ seems to recognize PRN and LPT1 as valid
outf <<... constants--no errors on run
but output is sent to screen(window).
the text says that stdio.h has a stream called stdprn
and i've tried to use
fprintf(stdprn,"this is a test");
just to try that, and it goes to screen also.
The least capability I need is to be able to create a file then
print hard copy from within the program...I would like to be able
to send individual lines to printer for headers or summary that I
don't want in the actual file.
Pardon me if I've missed something obvious.....
BTW this is windows 3.11 and borland c++4.52 (I also have turboc++3.1)
thanks in advance
kevin
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.