Search code examples
c++visual-c++visual-studio-debugging

Get messages to DebugView


I need to write application that could create debug messages that could be displayed in DebugView. For this purpose I'm using code:

int main ()
{
    OutputDebugString(L"hello");
    return 0;
}

But no messages are displayed in DebugViewer.

Where is problem?


Solution

  • DebugView won't receive debug messages if there is already a debugger the receives them. If you run your process under the IDE's debugger, then it receives these messages. Either:

    • View the debug messages in the IDE's window, or
    • Run the process outside the debugger and view the messages in DebugView.