遇到件怪事,我在 void CDialogBarEx::OnPaint() 中 获得了一个CEdit 的指针 p_edit = (CEdit*)this->GetDlgItem(IDC_MYEDIT1);其中 p_edit 为一个保护型的成员变量,但是不知道为什么,当程序在成员函数void CDialogBarEx::OnMyradio3() 中运行时,p_edit的值改变了,但是我并没有对其值做任何修改啊。照理说同一个类的成员变量值应该是不变的啊,为什么呢?
调试欢乐多
CWnd* pWnd = CWnd::FromHandle( m_hwnd );
CWnd* GetDlgItem( int nID ) const;void CWnd::GetDlgItem( int nID, HWND* phWnd ) const;Return ValueA pointer to the given control or child window. If no control with the integer ID given by the nID parameter exists, the value is NULL. The returned pointer may be temporary and should not be stored for later use.************************