I am working on one project where I have stucked on one problem of converting CStringW
to CStringA
for multibyte string like Japanese Language.
I am loading the string from string resources using LoadString()
Method.
I have tried following code but it does not seem to work.
CStringW csTest;
csTest.LoadString(JAPANESE_STRING);
CStringA Msg = CStringA(csTest); // Msg has been returned blank string
And
std::string Msg = CW2A(csTest);// Msg has been returned blank string
I have also tried
wcstombs()
too.
Can anyone tell me how I can convert CStringW
to CString
?
Thanks in advance.
CString
wide tochar*
. The transition by CStringA is more straightforward and manageable. – Lanford