Printing from Visual C++ output

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 10K views
Freyster98
Messages
49
Reaction score
0
I need to be able to print the output from my c++ program, which obviously comes up in a dos screen. Is there an easy way to print this without writing it into the code? Any help would be greatly appreciated.
 
Physics news on Phys.org
mgb_phys said:
myprogram.exe > result.txt
print result.txt or double click on result.txt and select print

excellent, thanks!
 
IIRC in good ole times it was something like myprogram.exe > prn or myprogram.exe > lpt1. No idea if it works in dosbox.
 
Not directly (at least for most simple laser printers)
You can share the regular system printer using network shares and then connect lpt1 to that printer.
eg.
net use lpt1: \\mymachine\myprinter

You can then print directly to lpt1: even if it is a gdi/winlaser on a usb port.