VS error 全集(error C2664: 'CWnd::MessageBoxW' : cannot convert parameter 1 from 'char *' to 'LPCTSTR'的解决方法)

我用的是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".
感谢您的阅读,若有不足之处,欢迎指教,共同学习、共同进步。 博主网址:http://www.cnblogs.com/ChinacloudTech/ 独立博客:http://futuretechx.com 如您喜欢,麻烦推荐一下;如您有新想法,欢迎提出,邮箱:1145356699@qq.com。 本博客为博主原创,欢迎转载,但必须注明博客来源。 更多关于游戏开发的内容也可关注微信公众号:微浪游戏
原文地址:https://www.cnblogs.com/ChinacloudTech/p/6410508.html