Domanda

I have a windows phone application which uses my own Windows Phone Runtime Component which has native C++ code in it. This is working fine. My problem now is that for easier error finding and debugging I want to see my logs from C++.

I have in my C++ code:

void MyNativeCPPClass::outputTest()
    std::cout << "Testing \n";
    std::cout << std::flush;
}

Now I do not see this output. My guess is, that it is send to a console and I don't see a console in a Windows Phone App. There I just have my output window. I have read about a ConsoleTraceListener, but I don't know how to configure it for windows phone. If that is even possible.

So I would like to know if I can somehow append my C++ std::cout to my Output window in my Windows Phone App? Or if that is not possible. How could I do log directly from C++, so that I can somehow see it in Visual Studio?

È stato utile?

Soluzione

If you need to do this for debugging purposes, I would recommend using OutputDebugString. Anything you output with this will appear in the Debug Output dialog in Visual Studio when it's attached to your Windows Phone app.

Make sure you attach the native debugger for this to work.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top