I have that function that work (I just have to turn wstring to WHAR* at the end):
wstring stringtowstring(string str)
{
WCHAR ch[256];
MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, (LPWSTR)ch, 256);
return wstring(ch);
}
But I would like to know why that doesn't:
WCHAR tmp[256];
swprintf(tmp, L"%s", "test");