CString and GetLength

I ran into this problem recently when debugging some native code and thought that it will be good to share this with everyone.   CString sampleString = CString(_T(“Sample\0String”), 14); int len = sampleString.GetLength();          // len is 14 CString trimmedString = sampleString.Trim(); // trimmedString = “Sample” CString newstring = CString(sampleString);   // newString = “Sample” len…

12