改变主窗口的标题一定要用
AfxGetMainWnd()->SetWindowText(_T("xx"));
而用改变控件标题的方法
GetDlgItem(IDD_MY_DIALOG)-> SetWindowText(_T("xx"));
则会出错,这是为什么?
AfxGetMainWnd()->SetWindowText(_T("xx"));
而用改变控件标题的方法
GetDlgItem(IDD_MY_DIALOG)-> SetWindowText(_T("xx"));
则会出错,这是为什么?
=======
先看一下GetDlgItem有没有成功。
nID
Specifies the identifier of the control or child window to be retrieved.
Return:
A pointer to the given control or child window.
以上是msdn对nID和返回值的解释。可见,当nID为控件的标识符时,返回指向控件的指针;当为窗口标示符时,返回指向其子窗口的指针。
则会出错,这是为什么?
---------------------------------------------------什么错误?
或者this->SetWindowText(_T("xx"));