CWnd::MessageBoxW”: 不能将参数 1 从“const char [16]”转换为“LPCTSTR
来源:互联网 发布:跑步软件咕咚 编辑:程序博客网 时间:2024/05/16 12:52
转载自http://blog.163.com/xin_qing2010/blog/static/1777373582011530102750463/
外面用vs2010编写mfc程序的时候经常要MessageBox("提示信息")函数,在vc6.0是没有问题的,但是在vs2005却会有下面的提示:
error C2664: “CWnd::MessageBoxW”: 不能将参数 1 从“const char [17]”转换为“LPCTSTR”
这个错误提示的原因是VS2005默认使用的是UNICODE字符集,在参数转换时会出错
解决方法很简单。
方法一:
MessageBox(_T"你已经提交成功。");
即在参数前加上_T
方法二:
在新建项目时,把使用UNICODE字符集取消,如下图:
方法三:
选择“项目”-》“XXX项目属性”-》“配置属性”-》“常规”选项中,把“字符集”改为“使用多字节字符集”,然后确定。如下图:
0 0
- CWnd::MessageBoxW”: 不能将参数 1 从“const char [16]”转换为“LPCTSTR
- CWnd::MessageBoxW”:不能将参数 1 从“const char [16]”转换为“LPCTSTR
- CWnd::MessageBoxW”: 不能将参数 1 从“const char [16]”转换为“LPCTSTR
- CWnd::MessageBoxW”:不能将参数 1 从“const char [16]”转换为“LPCTSTR
- error C2664: “CWnd::MessageBoxW”: 不能将参数 1 从“const char [17]”转换为“LPCTSTR”
- error C2664: “CWnd::MessageBoxW”: 不能将参数 1 从“const char [17]”转换为“LPCTSTR
- error C2664: “CWnd::MessageBoxW”: 不能将参数 1 从“const char [25]”转换为“LPCTSTR”
- error C2664: “CWnd::MessageBoxW”: 不能将参数 1 从“const char [17]”转换为“LPCTSTR”
- [Error]“CWnd::MessageBoxW”: 不能将参数 1 从“char [100]”转换为“LPCTSTR[转]
- VS2008下MessageBoxW出现不能将参数 1 从“const char [75]”转换为“LPCTSTR”
- error C2664:"CWnd::MessageBoxW"不能将参数从"const char[3]"转换为"LPCSTR"
- c++error:C2664“intCWnd::MessageBoxW(LPCTSTR,LPCTSTR,UINT)”: 无法将参数 1 从“const char [12]”转换为“LPCTSTR”
- error C2664: “CWnd::SetDlgItemTextW”: 不能将参数 2 从“const char [2]”转换为“LPCTSTR”
- 不能将参数1从“const char []”转换为“LPCTSTR
- 不能将参数1从“const char []”转换为“LPCTSTR
- 不能将参数1从“const char []”转换为“LPCTSTR
- :MessageBoxW”: 不能将参数 1 从“const char [5]”转换为“LPCTSTR” 1> 与指向的类型无关;转换要求 reinterpret_cast、C 样式
- int CWnd::GetWindowTextW(LPTSTR,int) const”: 不能将参数 1 从“char [10]”转换为“LPTSTR”
- 自作多情总是可悲
- 适配器模式(类对象结构型模式)
- 命令4-&&和||
- TCL脚本语言学习
- asterisk1.8 Makefile分析 (1)
- CWnd::MessageBoxW”: 不能将参数 1 从“const char [16]”转换为“LPCTSTR
- 深入学习python(一) lambda函数
- 个性酒吧花式调酒
- 依然亲爱的,你别来无恙。
- HTML5 Video 实现浅析
- SVN服务器的搭建和使用
- hdu1009简单数据结构-结构体&贪心比例最大以及sort快速排序
- 制作 ios framework
- Border属性