用MultiByteToWideChar怎么把一个C-style字符串转换成UniCode? 如何设置参数?能否给出例子.thanks. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 int MultiByteToWideChar( UINT CodePage, // code page DWORD dwFlags, // character-type options LPCSTR lpMultiByteStr, // string to map int cbMultiByte, // number of bytes in string LPWSTR lpWideCharStr, // wide-character buffer int cchWideChar // size of buffer);Sample:CString str = "string" ;LPWSTR lpszW = new WCHAR[255];LPTSTR lpStr = str.GetBuffer( str.GetLength() );int nLen = MultiByteToWideChar(CP_ACP, 0,lpStr, -1, NULL, NULL);MultiByteToWideChar(CP_ACP, 0, lpStr, -1, lpszW, nLen);delete []lpszW ; 关于修改内存地址的小问题 关于每次运行是否重新赋值问题 关于OnClose函数,求教 请问,如何让tooltip的字体和父窗口的 保持一致呢? 高手请进:关于Windows控制台 CMainFrame中的OnMouseMove是不是不能用 系统连接问题 如何用回调函数取得WINDOWS系统的右键菜单并添加自己的菜单项?(不用MFC或其他类库,只用API实现?) 一个vc问题 VC配置ODBC数据源的问题 如何给菜单栏和工具栏添加背景?谢谢! SOS录音机 我问了好几次了
UINT CodePage, // code page
DWORD dwFlags, // character-type options
LPCSTR lpMultiByteStr, // string to map
int cbMultiByte, // number of bytes in string
LPWSTR lpWideCharStr, // wide-character buffer
int cchWideChar // size of buffer
);Sample:CString str = "string" ;
LPWSTR lpszW = new WCHAR[255];LPTSTR lpStr = str.GetBuffer( str.GetLength() );
int nLen = MultiByteToWideChar(CP_ACP, 0,lpStr, -1, NULL, NULL);
MultiByteToWideChar(CP_ACP, 0, lpStr, -1, lpszW, nLen);
delete []lpszW ;