佚名通过本文主要向大家介绍了mbstowcs,mbstowcs s,天刀功力怎么提升,功力,天涯明月刀功力等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: [请教功力深厚者]关于mbstowcs与CComBSTR。
描述:
解决方案1:
描述:
CString a = "中文";
CComBSTR CCB(a);
wchar_t tmp[260];
mbstowcs(tmp,(LPCTSTR)a,260);
MessageBoxW(0,CCB,L"caption",MB_OK); //为什么这个是中文,
MessageBoxW(0,tmp,L"caption",MB_OK); //而这个是乱码?mbstowcs做了些什么?
解决方案1:
setlocale(LC_ALL,".ACP");
CString a = "中文";
CComBSTR CCB(a);
wchar_t tmp[260];
mbstowcs(tmp,(LPCTSTR)a,260);
MessageBoxW(0,CCB,L"caption",MB_OK);
MessageBoxW(0,tmp,L"caption",MB_OK);
请用OLE2W转换