> Sorry, this is incorrect. CString provides constructors that accept
> both ANSI and Unicode strings, and likewise operator = also accepts
> ANSI or Unicode. So it DOES provide conversions; just not on the way
> out, which is a pain if you need to use it for functions that just
> don't accept Unicode strings.
Well, yes, but I personally don't call such a thing "conversion." To me,
conversion means: "I give you this, and your return that." but CString ctors
go by the rule of "I give you this, and you give me whatever you wish
according to the current compilation settings."
> It's a throwback from 16-bit MFC: since Unicode wasn't prevalent in
> those days, the extraction operator (now
> (LPCTSTR) ) /was/ (const char *). I can't prove that since I
> inadvertently lost my copy of MSVC 1.52 and its help file, but believe
> me it used to be there.
I trust you on this. I guess on those days, if you asked MFC programmers
why they wouldn't consider Unicode, they would reply "consider what?". ;-)
> Fair enough, although it was never intended to be anything other than
> a quick test {:v)
I know, but there are actual uses for it.
One example: when I'm writing some code that means to be portable, and I'm
doing some OS/CPU specific operation, I use a construct like:
#ifdef _WIN32
do_the_hack();
#else
# error The code you see above is a hack! Please port it to the current
target platform.
#endif
Well, that's not really 'portable', but at least it prevents the Linux
programmer to discover it after sweating inside the debugger...
-------------
Ehsan Akhgari
Farda Technology (http://www.farda-tech.com/)
List Owner: [EMAIL PROTECTED]
[ Email: [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]
Mature manhood: that means to have rediscovered the seriousness one had as a
child at play.
-Beyond Good And Evil, F. W. Nietzsche