简体   繁体   English

将命令提示符输出重定向到Visual Studio 2012中的输出窗口

[英]Redirect command prompt output to output window in Visual studio 2012

How can I redirect everything printed onto the command prompt to be printed onto the output window in Visual studio 2012? 如何将打印到命令提示符上的所有内容重定向到要打印到Visual Studio 2012中的输出窗口上? I am looking for a console as shown in eclipse. 我正在寻找一个如Eclipse所示的控制台。

I am developing a console application in visual C++. 我正在用Visual C ++开发控制台应用程序。

I tried "using namespace System::Diagnostic" but this way I don't see any Debug.WriteLine in suggestions. 我尝试了“使用名称空间System :: Diagnostic”,但是这样我在建议中看不到任何Debug.WriteLine。 What other alternative do I have? 我还有什么其他选择?

This question is answered here . 这个问题在这里回答。 Anyway you should try work different approach, you may be used to Eclipse a I believe, you will get used to Visual Studio soon. 无论如何,您都应该尝试使用不同的方法,您可能已经习惯了Eclipse,我相信您很快就会习惯于Visual Studio。 I never needed to redirect the console output to Output Window. 我从来不需要将控制台输出重定向到“输出窗口”。

These two types of outputs has different purposes. 这两种类型的输出具有不同的用途。 Console Output is intended for the application itself (customer) and one Output Window is intended for debugging purposes. 控制台输出用于应用程序本身(客户),一个输出窗口用于调试目的。 You don't want to release debug messages to customer. 您不想将调试消息发布给客户。 Right? 对? But you don't want to delete or comment out debug messages every time you release the software. 但是您不想每次发布软件时都删除或注释掉调试消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM