获取combobox当前选中值的代码放在哪?

IDC_COMBO1在对话框(IDD_DIALOG1)上,IDD_DIALOG1|Add
Class|class CTextDialogalog: public CDialog;
BOOL CTextDialog::OnInitDialog(){}对combobox的选项初始化,
但是

 // Select the next item of the currently selected item 
// in the combo box.
int nIndex = m_pComboBox->GetCurSel();
int nCount = m_pComboBox->GetCount();
if ((nIndex != CB_ERR) && (nCount > 1))
{
   if (++nIndex < nCount)
      m_pComboBox->SetCurSel(nIndex);
   else
      m_pComboBox->SetCurSel(0);
}

获取当前选中值的代码应该放在什么function(?)?

http://blog.csdn.net/mlj318/article/details/6719022