Solved

Redirection to Printer from Visual C++

Posted on 1998-03-12
6
200 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now