It's a shame you had not used MFC's CString - it has a (const char *)Not really as then the MFC runtime libraries would have to be dragged into the ATL application. Jason, you know what I think of the MFC. ;-)
extraction operator to get out a char * even under Unicode conditions (and an (LPCTSTR) extraction operator for getting proper Unicode characters, as you would use in most other places).
In fact I'm not even keen on ATL's CString.
Ok now I'm officially confused. I thought MFC used ATL's CString in recent incarnations? (mfc & atl 7, msvc.net 2003).
> OP, why aren't you using std::string?
Well I normally do, but since this is a project with WTL/ATL I thought it would be easier to use CString since all WTL functions take CString arguments, and that way I wouldn't have to do all the ugly .c_str() thing every time. That and I like the .Format() way better than std::ostringstream. I used to be very much against CString as well but now that I've used it a bit more I can't really think of any good reasons any more why to use std::string. Would it solve my problem? I'd have to use std::wstring (or template my own class on TCHAR I guess) and I'd have to all conversion manually, or not?
cheers,
roel
