Convert CString to const char*

To convert a TCHAR CString to ASCII, use the CT2A macro – this will also allow you to convert the string to UTF8 (or any other Windows code page): // Convert using the local code page CString str(_T(“Hello, world!”)); CT2A ascii(str); TRACE(_T(“ASCII: %S\n”), ascii.m_psz); // Convert to UTF8 CString str(_T(“Some Unicode goodness”)); CT2A ascii(str, CP_UTF8); … Read more