I want to convert a CString to a string. (I know what I'm doing. I know that the returned string will be incorrect if the range of CString values ββis outside of ANSI, but that's fine!)
The following code will work under VC2008.
std::string Utils::CString2String(const CString& cString)
{
CT2CA pszConvertedAnsiString (cString);
std::string strStd (pszConvertedAnsiString);
return strStd;
}
But VC6 does not have a CT2CA macro. How can I make the code work on both VC6 and VC2008?
source
share