I am having a weird problem with CString I have the following code which gives an unexpected result:
CString sourcePath = _T("C:\\some\\path\\file.ext");
CString log;
log.Format(_T("Path = %s"), sourcePath);
the result string shows Path = (null).
I am not sure what is going on under the hood there, I have tried casting the sourcePath to an LPCTSTR and got a valid pointer and when viewing the content of that memory address in the memory view window of MSVC everything seems valid.
this annoys me as I have tried the same method in previous projects and it worked pretty well.
Thanks.
P.S. Please, before people start commenting here asking about what is a CString, as it happened in an earlier post of mine, please check here first: MSDN CString
Edit: sorry about the slash thingy.. and yes the original code does have double slashes..