Unicode类型的CString转化为char*
2008-04-14 13:04
246 查看
CString strPath = L"adfafs主声音文件fsfsa";
int nLength = strPath.GetLength();
int nBytes = WideCharToMultiByte(CP_ACP,0,strPath,nLength,NULL,0,NULL,NULL);
char* VoicePath = new char[ nBytes + 1];
memset(VoicePath,0,nLength + 1);
WideCharToMultiByte(CP_OEMCP, 0, strPath, nLength, VoicePath, nBytes, NULL, NULL);
VoicePath[nBytes] = 0;
int nLength = strPath.GetLength();
int nBytes = WideCharToMultiByte(CP_ACP,0,strPath,nLength,NULL,0,NULL,NULL);
char* VoicePath = new char[ nBytes + 1];
memset(VoicePath,0,nLength + 1);
WideCharToMultiByte(CP_OEMCP, 0, strPath, nLength, VoicePath, nBytes, NULL, NULL);
VoicePath[nBytes] = 0;
相关文章推荐
- unicode下各种类型转换,CString,string,char*,int,char[]
- 把Cstring类型的字符串转化为char* 字符串;
- CString与LPCWSTR、LPSTR、char*、LPWSTR等类型的转换 (UNICODE版本字符串转换为Ansi版本)
- UNICODE 下CString与char*的相互转化
- unicode下各种类型转换,CString,string,char*,int,char[]
- MFC中Unicode与多字节编码中遇到的CString与char或char*的转化问题
- unicode下各种类型转换,CString,string,char*,int,char[]
- unicode下各种类型转换,CString,string,char*,int,char[]
- MFC中Unicode与多字节编码中遇到的CString与char或char*的转化问题
- vs2010 unicode 下类型转换CString,char*,char,string,int,double
- VC中char* 转化为CString类型
- CString 与char* 之间相互转化的函数 UnicodeToAnsi AnsiToUnicode
- MFC:UNICODE下CString与char* ,string类型
- Unicode下CString(wchar_t)转换为 char*
- C++中char*和LPCTSTR类型的转化
- CString与LPCWSTR、LPSTR、char*、LPWSTR等类型的转换
- CString与LPCWSTR、LPSTR、char*、LPWSTR等类型的转换
- CString与LPCWSTR、LPSTR、char*、LPWSTR等类型的转换
- char*数组(c类型字符串)和Vc++中的CString的转换,char*数组等问题
- CString类型转换,字符串操作和UNICODE、ANSI字符集