Re: TCHAR * to WCHAR*
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Wed, 5 Dec 2007 16:46:43 -0600
"Giovanni Dicanio" <giovanni.dicanio@xxxxxxxxxx> wrote in message
news:uSppv34NIHA.5860@xxxxxxxxxxxxxxxxxxxxxxx
"Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx> ha scritto nel messaggio
news:umT%23hM3NIHA.6108@xxxxxxxxxxxxxxxxxxxxxxx
fn_name ((std::wstring("Error: ") + T2W(err.ErrorMessage()).c_str ());
missing L -- should be std::wstring(L"Error: ")
So ATL/MFC CString (or CStringW) seems smarter than std::wstring, because
CString has a constructor which takes a narrow character string and
converts to CString's type, without using the L or _T() decorator.
Why would you want a runtime conversion for a string literal? That's asking
for trouble, because it's likely to be user-preference dependent, in which
case, why use Unicode at all?
Giovanni
.
- Follow-Ups:
- Re: TCHAR * to WCHAR*
- From: Giovanni Dicanio
- Re: TCHAR * to WCHAR*
- References:
- TCHAR * to WCHAR*
- From: IdleBrain
- Re: TCHAR * to WCHAR*
- From: Brian Muth
- Re: TCHAR * to WCHAR*
- From: Ben Voigt [C++ MVP]
- Re: TCHAR * to WCHAR*
- From: Giovanni Dicanio
- TCHAR * to WCHAR*
- Prev by Date: Re: [vc7.1] #ifdef vista ?
- Next by Date: Re: Scott, here are the answers you requested.
- Previous by thread: Re: TCHAR * to WCHAR*
- Next by thread: Re: TCHAR * to WCHAR*
- Index(es):
Relevant Pages
|