Solved

Redirection to Printer from Visual C++

Posted on 1998-03-12
6
218 Views
Last Modified: 2010-04-10
In Turbo C, you could type, "go.exe >prn" and the output would go to the printer.  Is there any way to do this is Visual C++ 5.0?  Thanks.
0
Comment
Question by:LClos
6 Comments
 

Author Comment

by:LClos
ID: 1183392
Adjusted points to 100
0
 
LVL 22

Expert Comment

by:nietod
ID: 1183393
Try entering the "> prn" as if it were part of the program's argument.  You do this in the program settings, under the debug tab, in the program arguments box.
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1183394
Or you can open 'prn' in your program as an output stream, and redirect all the stdout to it.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 22

Expert Comment

by:nietod
ID: 1183395
q2quo, I suspect that LCLos wants a method that can be used for testing, not a method that requires altering the program.   However, that might not be possible and you method might be it.
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 100 total points
ID: 1183396
Redirection works from the command line for apps built with VC++ 5.0 just like it does in Turbo C++.  That is, if you build for /SUBSYSTEM:CONSOLE, stdout can be redirected just the way you describe.

.B ekiM
0
 
LVL 22

Expert Comment

by:nietod
ID: 1183397
Mike, I believe what LCLos wants to do is be able to run the program from within VC (under the debugger etc) but have the ouput redirected.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question