error C2440: 'initializing' : cannot convert from 'const char [11]' to 'ATL::CStringT<BaseType,Strin

该错误长出现在VC 2005及以上版本,因为VC 2005在创建工程时,默认的数据
Character是Unicode,所以当你进行如下定义时:
CString strTemp = "aaaaaaaaa";
编译时就会报上边的错误。
该错误的修改方法有两种:
(1)修改工程的设定。点击“Solution Explorer”的工程名,选择右键菜单
的“properties”,或者点击“project” -> “properties”选项。在弹出的
“工程名 Property pages”窗体中,选择“Genenal”选项。把Character 
Set的选项改为“No Set”。
(2)凡是在出现字符串的地方,加_T()。如CString strTemp = _T("aaaaaaa");

原文地址:https://www.cnblogs.com/huhewei/p/6198599.html