Quote Originally Posted by martho
CString s = "Hello";
(error C2440: 'initializing' : cannot convert from 'const char [6]' to 'ATL::CStringT<BaseType,StringTraits>')

But I can compile lines like:
CString s("Hello");
This behaviour is correct, and by design for UNICODE builds.

The reason is that you are using the CStringT constructor implicitly for converting from normal character strings to a (CString wrapped) Unicode string.

To use implicit conversions, you need to comment the macro definition -
Code:
// #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS  // Comment this out to support implicit conversions
inside your StdAfx.h

When you do this, you will see that both lines compile.

Else, only the latter will.

However, note that the best way to construct objects is explicitly, and not implicitly (hence, the latter is disabled by default).

To understand this topic some more, look up -