我正在使用Visual Studio 2008调试Windows Mobile 6.5应用程序,如果我可以在程序运行时获得控制台输出,那就太好了。如何在Visual Studio IDE中从模拟器上运行的代码中读取printf的输出?
答案 0 :(得分:1)
Windows Mobile没有控制台或控制台输出。您可以安装控制台http://windowsmobilepro.blogspot.de/2006/05/pocket-pc-console-for-standard-input.html和http://handheld.softpedia.com/get/System-Utilities/Enhancements/MS-Console-69411.shtml
但是对于调试我想要使用它们。
使用DEBUGMSG或RETAILMSG代替printf。例如:
DEBUGMSG(1,(L“函数x:Lasterror为0x%08x \ n”,GetLastError()));
您也可以稍后将调试附加到正在运行的应用程序,然后观察VisualStudio输出窗口以获取调试消息。