I feel so dumb asking this question but honestly I can't understand why System namespace can't be used! What am I doing wrong? Is there any other way to print a single line in the output? (I am using Visual Studio 2015)
I can't understand why System namespace can't be used
Windows Universal app is totally different with traditional desktop app, please check Windows Runtime APIs and Win32 and COM API which lists all Win32 and COM APIs supported for use in UWP apps.
Is there any other way to print a single line in the output? (I am using Visual Studio 2015)
If you need to print message to Output window, use OutputDebugString function in UWP C++/CX project, adding #include to access it, for example:
void CPPUWPApp1::MainPage::LogMessage(Object^ parameter)
{
auto paraString = parameter->ToString();
auto formattedText = std::wstring(paraString->Data()).append(L"\r\n");
OutputDebugString(formattedText.c_str());
}
Usage:
LogMessage("Hello World!");
You could do this directly:
OutputDebugString(L"Hello World");
Notice the L in front of the string, to convert it directly to LPCWSTR.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With