在一个按钮的OnsendButton()函数里我加了CEdit* p = (CEdit*)GetDlgItem(IDC_EDIT1);
   p->SetWindowText("123456");
但是没有显示123456

解决方案 »

  1.   

    检查一下p指针是否是Cedit类型的指针
    然后查看p->GetSafeHwnd()是否是合法窗口句柄另外,IDC_EDIT1空间应该在调用GetDlgItem的对话框上
      

  2.   

    直接用SetDlgItemText应该就可以了,不用这样。
      

  3.   

    Cedit ?用mfc的control变量CString 类型的,定义一个然后给值最后updatedata(FALSE)
      

  4.   

    发现是我resource文件搞错了如果想不断加入数据应该怎么操作?SetWindowText每次都清空 才加数据只有用CListBox->AddString()吗?
      

  5.   

    ReplaceSel Replaces the current selection in an edit control with the specified text.
      

  6.   

    http://community.csdn.net/Expert/topic/4534/4534311.xml?temp=.1146814