weixin_44158993 2019-12-20 11:52 采纳率: 0%
浏览 522

VC++ MFC getwindowtext(),使用提示的错误原因是什么

VC++ MFC getwindowtext(),使用提示的错误原因是什么

int num1,num2,num3;
char ch1[12],ch2[12],ch3[12];
m_edit1.GetWindowText(ch1); //在ch1后面不标注长度,会提示出错,size
主要是什么作用
m_edit2.GetWindowText(ch2,12);
num1=_ttoi(ch1);
num2=_ttoi(ch2);

num3=num1+num2;
_itot(num3,ch3,10);
m_edit3.SetWindowText(ch3);

错误提示:
C:\Program Files (x86)\Microsoft Visual Studio\HD_RZG_CiTOS_4.5_EX\HD_RZG_CiTOS_4.5_EX\04_SRC\plan\project\test3\test3Dlg.cpp(270) : error C2664: 'void __thiscall CWnd::GetWindowTextA(class CString &) const' : cannot convert parameter 1 from 'char [
12]' to 'class CString &

  • 写回答

1条回答 默认 最新

  • threenewbee 2019-12-21 18:27
    关注

    CString s(ch3);
    m_edit3.SetWindowText(s);

    评论

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制