Hello,
I'm using Chili Framework 2016 in Visual Studio to test a simple project. I wanted to use OutputDebugString to show in the output some variables. But it doesn't compile.
When I try to compile the program is says:
'void OutputDebugStringW(LPCWSTR)': cannot convert argument 1 from 'const char *' to 'LPCWSTR' Engine
This is the code, nothing strange, just a simple debug.
std::stringstream ss;
ss << " Pickups "<<std::endl;
OutputDebugString(ss.str().c_str());
I'm using Visual Studio 2015 Community.
Thanks
Problems with OutputDebugString
Re: Problems with OutputDebugString
The builds are likely using unicode, you could use wstringstream instead or OutputDebugStringA (ASCII version)
Re: Problems with OutputDebugString
Yup, the framework solution is setup to use wide character strings (16-bit chars on Windows). If you want to use wide strings, use wstring instead of string, and ditto for wstringstream, to_wstring, etc.
Your string literals should also be L" Pickups " (prefix with L to denote a wide char string literal).
Your string literals should also be L" Pickups " (prefix with L to denote a wide char string literal).
Chili
Re: Problems with OutputDebugString
Yup!
That worked thanks!! Problem solved
That worked thanks!! Problem solved