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