sparkythedog
asked on
Convert Unicode CString to STL::string
How to convert an Unicode CString to STL::string?
Thanks
Thanks
ASKER
Hi there,
thanks for your reply
I need the STL string to contain the UNICODE string from CString.
Thanks
thanks for your reply
I need the STL string to contain the UNICODE string from CString.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CString strUni = L"Test";
size_t len = strUni.GetLength() + 1;
char* psz = new char[len];
wcstombs(psz,(LPCTSTR)strU
std::string str = psz;
delete [] psz;