Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make output of console application directly into Visual Studio and not external Windows console

Being a new user of Visual Studio Community (2017), I had the bad surprise to find that my C++ console application runs in a console external to the IDE.

So I would like to know how to make my program run directly in the IDE, as it is the case for Eclipse, VSCODE, IntelliJi etc....

I have already tried the proposed solution on this subject: How do you run a console application in the Visual Studio output window, instead of opening a new command prompt? but it doesn't work for my version of VSC (2017).

I would like to know if it's possible with my version and, if yes, what changes must be done with the configuration of the IDE.

How it works now

How I would like to be


1 Answers

In managed code, you could try to use System::Diagnostics::Debug::Write. In unmanaged code, You could try to use OutputDebugString. In both cases, the text will go to the Output window rather than the Immediate window. If you want it in the immediate window, inside VS you can go to Tools -> Options -> Debugging -> General and check the "Redirect all Output Window text to the Immediate Window" option.

Use the Immediate window to debug and evaluate expressions, execute statements, and print variable values. And we couldn't run the console application in the Immediate window.

As far as I'm concerned ,We couldn't equate the system console with an Immediate window. And A console application should run in the system console.

like image 59
Jeaninez - MSFT Avatar answered Oct 19 '25 03:10

Jeaninez - MSFT