title: CBN_SELCHANGE in Dynamically created ComboBoxes
body: <p>How to get the CBN_SELCHANGE in dynamically created CComboBoxes??.. I used a array of CComboBoxes.</p>
  
  <pre><code>MyCComboBox * p_ComboBoxes = new MyCComboBox[numberOcComboBoxes]; //numberOcComboBoxes determined at rumtime
  </code></pre>
  
  <p>In the message Map of MyCComboBox </p>
  
  <pre><code>BEGIN_MESSAGE_MAP(MyCComboBox , CComboBox)
      ON_CONTROL_REFLECT(CBN_SELCHANGE, &amp;CTestDlg::OnCbnSelchange)
  END_MESSAGE_MAP()
  
  void CTestDlg::OnCbnSelchange()
  {
  this-&gt;GetDlgCtrlID(); // Get The ComboBox ID;
  CString sText;
  p_ComboBoxes[0].GetLBText(p_ComboBoxes[0].GetCurSel() , sText); // I can't access like this 
  
  
  }
  </code></pre>
  
  <p>// Initialization of the p_ComboBoxes Array..</p>
  
  <pre><code>for (int i = 0 ;i &lt; iNumber ; i++)
  {
  
  
  p_ComboBoxes[i].Create(WS_CHILD|WS_VISIBLE|WS_VSCROLL|CBS_DROPDOWN,
          CRect(10 + MY_PIC_ADDITIONAL_WIDTH,iItemDrawHeight,10 + MY_PIC_ADDITIONAL_WIDTH +MY_PIC_PROPERTY_WIDTH
          ,iItemDrawHeight +MY_PIC_HEIGHT), this, pImageControlPropertyID[i]);
  
  iItemDrawHeight += MY_PIC_PROPERTY_ADDITIONAL_HEIGHT;
  
  }
  </code></pre>
  
  <p>I can't access the selected text it gives me "Access violation reading location 0x00000020" error..</p>