Solved

Redirection to Printer from Visual C++

Posted on 1998-03-12
6
211 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SetCurrentDirectory path limit 7 121
Would like to move button in a function 3 77
How to split this in C++ 4 102
How to convert MFC APP to Win32 APP. 19 81
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

777 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