我用的是VS2005,在编译MFC时遇到了如下错误:
error C2664: 'CWnd::MessageBoxW' : cannot convert parameter 1 from 'char *' to 'LPCTSTR'
后来发现解决方法很简单,点击“项目”-》“属性”-》“配置属性”-》“常规”-》“字符集”选择“使用多字节字符集”
问题解决,后来发现很多问题都能通过这个办法解决,如:
error C2440: '=' : cannot convert from 'const char [13]' to 'LPCWSTR'。
等问题都能用该方法解决。
 
vs 2010英文版下:
Change your project configuration to use multibyte strings. Press ALT+F7 to open the properties, and navigate to Configuration Properties > General. Switch Character Set to "Use Multi-Byte Character Set".

转载于:https://www.cnblogs.com/ChinacloudTech/p/6410508.html

Logo

昇腾计算产业是基于昇腾系列(HUAWEI Ascend)处理器和基础软件构建的全栈 AI计算基础设施、行业应用及服务,https://devpress.csdn.net/organization/setting/general/146749包括昇腾系列处理器、系列硬件、CANN、AI计算框架、应用使能、开发工具链、管理运维工具、行业应用及服务等全产业链

更多推荐