Ashutosh Rautela
Ashutosh Rautela

Reputation: 5

Is it possible to debug in console in a Win32 C++ Application in Visual Studio?

As the question mentions, I am finding it hard to debug and output in a Win32 Windows Program in Visual Studio. I have used SDL2.0 for OpenGL Projects and SDL window opens with the console as well, so it becomes easy to debug and output anything on the console anytime. How can I achieve this in Win32 API? Is it anyhow possible to open the console in a Win32 application?

Upvotes: 0

Views: 1144

Answers (1)

user2100815
user2100815

Reputation:

You can do this via the AttachConsole and/or AllocConsole functions of the Windows Console API (see https://learn.microsoft.com/en-us/windows/console/console-functions). You can also simply create a Console Application in your IDE, and call your GUI code from that application.

Upvotes: 1

Related Questions