Home > Software engineering >  The error C2039: 'SetCheck' : is not a member of 'CWnd'
The error C2039: 'SetCheck' : is not a member of 'CWnd'

Time:10-11

Void CModelFixDlg: : OnBnClickedSelectall ()
{
//TODO: Add your the control notification handler code here
(CButton *) GetDlgItem (IDC_OppositeVector) - & gt; SetCheck (FALSE);
}
MFC in the learning process to set up a selection button, why will prompt the error C2039: 'SetCheck' : is not a member of 'CWnd'

CodePudding user response:

Try to add parenthesis:
GetDlgItem (CButton
 (*) (IDC_OppositeVector)) - & gt; SetCheck (FALSE); 

CodePudding user response:

Check the MSDN, looking for his own answer

CodePudding user response:

Moderator solution or if you define a button object button button. Setchek (0);

CodePudding user response:

reference 1st floor qq423399099 response:
add a bracket try:
GetDlgItem (CButton
 (*) (IDC_OppositeVector)) - & gt; SetCheck (FALSE); 

Or step by step
CButton * pBtn=(CButton *) GetDlgItem (IDC_OppositeVector);
If (pBtn) pBtn - & gt; SetCheck (FALSE);
  • Related