string CUtility::TCHAR2char(TCHAR* tchStr) { int iLen = 2*wcslen(tchStr); char* chRtn = new char[iLen+1]; memset(chRtn, 0, iLen + 1); wcstombs(chRtn,tchStr,iLen+1); string str(chRtn); delete[] chRtn; return str; }
Powered by: 博客园 Copyright © 2024 Roger Luo Powered by .NET 9.0 on Kubernetes