Tag: convert
wchar_t* To std::string
admin | win32 | 2013-07-18
C++
bool wcharToString(IN wchar_t* wText, OUT string& str)
{
//WideCharToMultiByte的运用
DWORD dwNum = WideCharToMultiByte(CP_OEMCP,NULL,wText,-1,NULL,0,NULL,FALSE);
//psText为char*的临时数组,作为赋值给std::string的中间变量
char *psText;
psText = new char[dwNum];
// WideCharToMultiB... [阅读全文]