How to convert CString and ::std::string ::std::wstring to each other?
问题 CString is quite handy, while std::string is more compatible with STL container. I am using hash_map . However, hash_map does not support CString as key, so I want to convert CString into std::string . Writing a CString hash function seems to take a lot of time. CString -----> std::string How can I do this? std::string -----> CString: inline CString toCString(std::string const& str) { return CString(str.c_str()); } Am I right? EDIT: Here are more questions: How can I convert wstring , CString