2012-07-04 26 views

回答

4

metro风格的应用程序不能有控制台。您可以在C++/CXX应用程序中使用OutputDebugString()在Visual Studio输出窗口上显示调试文本,就像System.Diagnostics.Debug.Write在托管应用程序中所做的一样。有没有很多批准的winapi函数,但OutputDebugString()没问题。从MSDN页面is here开始。

+0

in c#System.Diagnostics.Debug.Write其工作正常.. – Narasimha

+0

在Metro应用程序中没有System :: Diagnostics命名空间: – RelativeGames

0

如果你正在创建一个GUI应用程序,你可以自己启用控制台。

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

然后,你可以简单的std :: cout或printf你的诊断信息。

相关问题