locked
Output debug information to the screen

    Question

  • All,

    Is there a way to output debug information to a windows 8 app? Kind of like printf statements in C.

    Thanks,

    A.B.

    Monday, December 15, 2014 8:18 PM

Answers

  • The easiest thing to do is to use OutputDebugStringA in combination with sprint_s.
    • Marked as answer by A.B. Lambert Monday, December 15, 2014 8:59 PM
    Monday, December 15, 2014 8:22 PM
  • It's essentially the same as for a Windows Desktop (but not console) app:

    Typically I'll use OutputDebugString to dump debug output to the debug console. You can wrap this with a varargs function to get printf-like formatting.

    For on-screen you can create your own output window. A ListView bound to a collection of logged strings can work well.

    • Marked as answer by A.B. Lambert Monday, December 15, 2014 8:59 PM
    Monday, December 15, 2014 8:25 PM
    Moderator

All replies

  • The easiest thing to do is to use OutputDebugStringA in combination with sprint_s.
    • Marked as answer by A.B. Lambert Monday, December 15, 2014 8:59 PM
    Monday, December 15, 2014 8:22 PM
  • It's essentially the same as for a Windows Desktop (but not console) app:

    Typically I'll use OutputDebugString to dump debug output to the debug console. You can wrap this with a varargs function to get printf-like formatting.

    For on-screen you can create your own output window. A ListView bound to a collection of logged strings can work well.

    • Marked as answer by A.B. Lambert Monday, December 15, 2014 8:59 PM
    Monday, December 15, 2014 8:25 PM
    Moderator
  • Works great!!
    Monday, December 15, 2014 9:00 PM