Winform应用程序中的cout去了哪里
我正在尝试将 libusb 用于 WinForm 应用程序。
我使用了几个示例代码,这些代码使用大量标准输出流符号进行调试。
cout<<"Interfaces: "<<(int)config->bNumInterfaces<<" ||| ";
此代码将打印在 Linux 或命令行应用程序的控制台上。但是对于Winform来说,这个去哪里呢?我想知道是否可以设置我的 MSVC++ 项目,以便所有 cout 或 printf 调用都将打印到输出窗口,类似于 Console::WriteLine() 方法。
有什么建议吗?
I am trying to use the libusb to a WinForm application.
I used several sample codes that uses a lot of standard output stream notations for debugging.
cout<<"Interfaces: "<<(int)config->bNumInterfaces<<" ||| ";
This codes would print on the console for linux or command line app. But for Winform, where does this go? I would like to know if I could set my MSVC++ project so all cout or printf calls would print to the Output window similar to the Console::WriteLine() method.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
输出仍然转到标准输出流。没有控制台,因此您看不到它。但是,如果您启动该进程并重定向标准输出(以编程方式),您就会看到它。
使用 OutputDebugStream() 写入输出窗口。 (.NET 中的Debug.WriteLine() )
The output still goes to the standard output stream. There is no console so you can't see it. However if you launched the process and redirected standard output (programatically) you would see it.
Use OutputDebugStream() to write to the output window. (Debug.WriteLine() in .NET)