views:

127

answers:

1

I am using ASSERTE macro to check for pre-conditions. According to its definition it is using ASSERT_BASE, which in turn calls _CrtDbgReportW to print out the message. Where does _CrtDbgReportW output goes to?

I would assume that if the application is started from debugger, it would go to debugger window. Where would the messages go if it is not under debugger?

A: 

The output for _CrtDbgReportW depends on how you set it up. By default it sends it to the OutputDebugString API.

Debuggers trap the OutputDebugString output and normally display them in the debugger window as you suggest.

There are also applications that trap the output like DebugView that you can use for PC applications.

Update: I missed the Windows Mobile bit. I still beleave that it's output to the OutputDebugString but I don't know of any third party application that works. The only way I know of to trap the OutputDebugString output under Windows Mobile is to use the Debugging Functions DebugActiveProcess / WaitForDebugEvent to trap the OUTPUT_DEBUG_STRING_EVENT events and write them out somewhere.

Shane Powell