locked
How to log debug info to console in metro app eg: through printf or OutputDebugString

    Question

  • Hi,

    i have a sample C++ based metro app and i am trying to print some debug information to console through

    printf , OutputDebugString and Platform::Details::Console::WriteLine("\nHello there");

    the problem is i dont see the output in the console for any of the above cases.

    How do i get this working ? 

    Thanks,


    Raj

    Monday, August 13, 2012 2:04 PM

Answers

All replies

  • What do you mean by "Console" in this context?

    OutputDebugString's output will be picked up by the debugger and displayed. By default, Visual Studio shows it in the "Output" window.

    Platforms::Details::Console is documented as for internal use only and should not be used.

     --Rob

    Monday, August 13, 2012 9:41 PM
    Owner
  • By "Console" i meant the "Output" window of the visual studio debugger.


    Raj


    • Edited by naiveCoder Tuesday, August 14, 2012 6:19 AM
    Tuesday, August 14, 2012 6:19 AM
  • You can use OutputDebugString API:

    OutputDebugString(L"Hello world");

    http://msdn.microsoft.com/en-us/library/aa363362%28VS.85%29.aspx

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jesse Jiang Monday, August 20, 2012 7:38 AM
    Tuesday, August 14, 2012 8:16 AM
  • By default OutputDebugString from a debugged app will go to Visual Studio's "Output" window, but you can set options to push it to the Immediate window instead so check both places.

    This should work for you. If it's not we would need more information about your exact setup and repro steps.

    --Rob

    Tuesday, August 14, 2012 11:43 PM
    Owner
  • This is not working for me. The method is not resolved. Is there something I'm missing?
    Monday, October 01, 2012 7:23 PM