visual-c++coutoutput-window

Where does the cout go on Winform Application


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?


Solution

  • 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)