title: Referencing ComboBox Items after CBN_SELCHANGE C++ WIN32
body: <p>I have a Combo Box with 3 options in it for a start up menu. Of the options, 2 out of 3 of them will have some sort of effect on the other startup menu options. For example, if I select option 1, it would select a checkbox for another option, just so the user can see what each option in the combo box actually does before starting the program. </p>
  
  <p>My issue right now is that I have used "ON_CBN_SELCHANGE" in my message map to detect an option change in the combo box which would execute a function, however, this function cannot access the values of my combo box. So if I were to try to use the "GetCurSel()" function, it keeps returning a value of 0. How do I go about solving this?</p>
  
  <pre><code>//Message map
  BEGIN_MESSAGE_MAP(COptionsDlg, CDialog)
       ON_CBN_SELCHANGE(600, COptionsDlg::OnOptionSelect)
  END_MESSAGE_MAP()
  
  //This is the constructor for my combo box
  for(int i = 0; i &lt; m_OptionsList.size(); i++)
  {
      CComboBox* ComboBox = new CComboBox();
      ComboBox-&gt;Create(WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWN, CRect(Left + 10, *Top, Right - 10, *Top + 300), this, 600);
      ComboBox-&gt;SetFont(DialogFont);
  
      for(int j = 0; j &lt; m_OptionsList[i]-&gt;Labels.size(); j++)
      {
          ComboBox-&gt;AddString(m_OptionsList[i]-&gt;Labels[j]);
      }
  
  }
  
  //This is the function which executes after an option change occurs in the combo box
  void COptionsDlg::OnOptionSelect(void)
  {
      for(int i = 0; i &lt; m_ComboBoxList.size(); i++)
      {
          int Index = m_ComboBoxList[i]-&gt;TheControl-&gt;GetCurSel();
  
          if(Index == 1 || Index == 0)
          {
              //Code that should run if those options are selected
          }
      }
  }
  </code></pre>