error C2664: “CWnd::MessageBoxW”: 不能将参数 1 从“const char [17]”转换为“LPCTSTR
2013-05-23 11:20
417 查看
http://blog.sina.com.cn/s/blog_65cab32d010166md.html
在vs2010的菜单的学习中,本人遇到如下问题:
给某个菜单项添加一个事件处理程序:
1. void CMainFrame::OnTest()
2. {
3. MessageBox("you clicked Menu item.");
4. // TODO: 在此添加命令处理程序代码
5. }
编译时报告如下错误:error C2664: “CWnd::MessageBoxW”: 不能将参数 1 从“const char [17]”转换为“LPCTSTR‘’
解决方法如下:
方法1:
参数前加上_T
即:MessageBox(_T"you clicked Menu item.");
方法2:
在新建项目时,把使用UNICODE字符集取消,如下图:设为未设置
方法3:
修改如下属性【字符集】的值为【使用多字节字符集】
error C2664: “CWnd::MessageBoxW”:
不能将参数 1 从“const char [17]”转换为“LPCTSTR”
在vs2010的菜单的学习中,本人遇到如下问题:给某个菜单项添加一个事件处理程序:
1. void CMainFrame::OnTest()
2. {
3. MessageBox("you clicked Menu item.");
4. // TODO: 在此添加命令处理程序代码
5. }
编译时报告如下错误:error C2664: “CWnd::MessageBoxW”: 不能将参数 1 从“const char [17]”转换为“LPCTSTR‘’
解决方法如下:
方法1:
参数前加上_T
即:MessageBox(_T"you clicked Menu item.");
方法2:
在新建项目时,把使用UNICODE字符集取消,如下图:设为未设置
方法3:
修改如下属性【字符集】的值为【使用多字节字符集】
相关文章推荐
- 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: 不能将参数 1 从“const char [17]”转换为“LPCTSTR”
- CWnd::MessageBoxW”:不能将参数 1 从“const char [16]”转换为“LPCTSTR
- CWnd::MessageBoxW”: 不能将参数 1 从“const char [16]”转换为“LPCTSTR
- VS2010 error C2664: “CWnd::MessageBoxW”: 不能将参数 1 从“const char [3]”转换为“LPCTSTR”
- CWnd::MessageBoxW”: 不能将参数 1 从“const char [16]”转换为“LPCTSTR
- CWnd::MessageBoxW”:不能将参数 1 从“const char [16]”转换为“LPCTSTR
- error C2664: “CWnd::SetDlgItemTextW”: 不能将参数 2 从“const char [2]”转换为“LPCTSTR”
- :MessageBoxW”: 不能将参数 1 从“const char [5]”转换为“LPCTSTR” 1> 与指向的类型无关;转换要求 reinterpret_cast、C 样式
- 【转载】C++编译出现 error C2664: 不能将参数 2 从“const char [5]”转换为“LPCTSTR”解决办法。
- error C2664:"CWnd::MessageBoxW"不能将参数从"const char[3]"转换为"LPCSTR"
- error C2664: “CButton::Create”: 不能将参数 1 从“const char [1]”转换为“LPCTSTR
- error C2664: “CButton::Create”: 不能将参数 1 从“const char [5]”转换为“LPCTSTR”
- [Error]“CWnd::MessageBoxW”: 不能将参数 1 从“char [100]”转换为“LPCTSTR[转]
- error C2664: “CListBox::AddString”: 不能将参数 从“const char [5]”转换为“LPCTSTR”
- error C2664: “MessageBoxW”: 不能将参数 2 从“const char [10]”转换为“LPCWSTR”
- error C2664: “MessageBoxW”: 不能将参数 2 从“const char [36]”转换为“LPCWSTR”
- DX中关于error C2664: “ID3DXEffect::SetMatrix”: 不能将参数 1 从“const char [17]”转换为“D3DXHANDLE”