I am trying to check a radio button, I am new to c++ and MFC so after some search I wrote :
INT m_nIndex;
CButton* pButton1 = (CButton*) GetDlgItem(IDC_RADIO1);
CButton* pButton2 = (CButton*) GetDlgItem(IDC_RADIO2);
pButton1->SetCheck(m_nIndex == 0);
pButton2->SetCheck(m_nIndex == 1);
if (pButton1.IsChecked){ //Here pButton1 shows an error saying expression much have a class type
}
What can I do to call the radioButton?
Another Question, how to put a radioButton checked by default?