Hi.
Add this two simple functions and use its.
void MakeUnicodeString(CStringW &cstrW, const char* multibyte)
{
int nbytes = MultiByteToWideChar(CP_ACP,0,multibyte,-1,0,0);
WCHAR *wstr = new WCHAR[nbytes+2];
MultiByteToWideChar(CP_ACP,0,multibyte,-1,wstr,nbytes);
wstr[nbytes]=0;
cstrW = wstr;
delete [] wstr;
}
void MakeAnsiString(CString &cstr, const WCHAR* wide)
{
int nbytes = WideCharToMultiByte(CP_ACP,0,wide,-1,0,0,0,0);
char *str = new char[nbytes+2];
WideCharToMultiByte(CP_ACP,0,wide,-1,str,nbytes,0,0);
str[nbytes]=0;
cstr = str;
delete [] str;
}
Write me for any questions in google++ or blog:
http://strongcpp.blogspot.ru/[
^]