error C2664: “int CWnd::GetWindowTextW(LPTSTR,int) const”: 不能将参数 1 从“char [10]”转"相关的问题
2015-10-08 09:45
344 查看
为了解决用户可能碰到关于"error C2664: “int CWnd::GetWindowTextW(LPTSTR,int) const”: 不能将参数 1 从“char [10]”转"相关的问题,经过收集整理为用户提供相关的解决办法,请注意,解决办法仅供参考。"error C2664: “int CWnd::GetWindowTextW(LPTSTR,int) const”: 不能将参数 1 从“char [10]”转"相关的详细问题如下:
int num1,num2,num3;
char ch1[10],ch2[10],ch3[10];
GetDlgItem(IDC_EDIT1)->GetWindowText(ch1,10);
GetDlgItem(IDC_EDIT1)->GetWindowText(ch2,10);
num1=atoi(ch1);
num2=atoi(ch2);
num3=num1+num2;
itoa(num3,ch3,10);
GetDlgItem(IDC_EDIT3)->SetWindowText(ch3);
孙老师的源码在vs2010里提示这个错误,怎么回事呢?
解决方法:
右击当前项目,选择属性,在项目默认值下面的“字符集”选项改为“使用多字节字符集”就可以了。这是多种编程语言标准不统一造成的。
int num1,num2,num3;
char ch1[10],ch2[10],ch3[10];
GetDlgItem(IDC_EDIT1)->GetWindowText(ch1,10);
GetDlgItem(IDC_EDIT1)->GetWindowText(ch2,10);
num1=atoi(ch1);
num2=atoi(ch2);
num3=num1+num2;
itoa(num3,ch3,10);
GetDlgItem(IDC_EDIT3)->SetWindowText(ch3);
孙老师的源码在vs2010里提示这个错误,怎么回事呢?
解决方法:
右击当前项目,选择属性,在项目默认值下面的“字符集”选项改为“使用多字节字符集”就可以了。这是多种编程语言标准不统一造成的。
相关文章推荐
- iOS开发之窥探UICollectionViewController(四) --一款功能强大的自定义瀑布流
- POJ 2914 Minimum Cut 最小割图论
- AngularJS指南文档
- iOS中的block全面分析
- Length of Last Word | leetcode 58 【Java solving】
- ${}标签不起作用
- sql 修改表结构
- vs中 main和_tmain的区别
- linux之cut用法
- CocoaPods的安装和使用
- NStimer禁忌
- APP安全测试汇总
- 火云开发课堂 - 《Shader从入门到精通》系列 第二十一节:在Shader中对3D模型进行区域遮罩
- Murano Weekly Meeting 2015.10.06
- OpenWrt的luci web管理器添加新菜单(二)
- 我试试
- linux 网卡配置详解 ifcfg-eth0
- Android 中的 Service 全面总结
- 作业1:项目范围管理作文提纲
- 如何恢复Windows引导