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

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 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?