|
/******************************************************************************************
Function: TCHAR2STRING
Description: TCHAR转string
Input: str:待转化的TCHAR*类型字符串
Return: 转化后的string类型字符串
*******************************************************************************************/
[code]static CString TCHAR2STRING(TCHAR* str){
CString strstr;
try
{
int iLen = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
char* chRtn = new char[iLen * sizeof(char)];
WideCharToMultiByte(CP_ACP, 0, str, -1, chRtn, iLen, NULL, NULL);
strstr = chRtn;
}
catch (exception e)
{
}
return strstr;
}[/code] |
|