I'm trying to set some check boxes as checked by default in my MFC dialog when it runs.
I have created a CButton variable for the check box called m_check.
Next I added m_check.SetCheck in OnInitDialog.
BOOL CModelDlg::OnInitDialog()
{
....
m_check.SetCheck;
....
The error always appears:
Error: a pointer to a bound function may only be used to call the function.
I'm not sure what this error means. Any help would be appreciated. Thank you!
I figured it out in case anybody wants to know. Add this in OnInitDialog:
CButton* pBtn = (CButton*) GetDlgItem(IDC_XXXXXX);
pBtn->SetCheck(1);
I think you forgot parenthesis in the SetCheck function. It should be
BOOL CModelDlg::OnInitDialog() {
....
m_check.SetCheck(TRUE);
....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With