How to write a console / enter VC ++ in a Metro application?

I am working on a vC ++ application, in this application How to write to the console / log?

C # ---- system.diagnostics.debug.writeline ("Hello"); similar to VC ++ ----?

+4
source share
2 answers

A metro style app cannot have a console. You can use OutputDebugString () in a C ++ / CXX application to display debug text in the Visual Studio output window, as well as in System.Diagnostics.Debug.Write in a managed application. There are not many approved winapi functions, but OutputDebugString () is fine. Starting from the MSDN page here .

+4
source

if you are creating a GUI application, you can enable the console yourself.

AllocConsole(); freopen("CONOUT$", "w+t", stdout); 

and then you can run simple diagnostic messages std :: cout or printf.

0
source

All Articles