CString GetComboBoxStr( int nID ) { CString str; CComboBox * pCombo = ( CComboBox * )GetDlgItem( nID ); int nIndex = pCombo->GetCurSel(); if( nIndex != -1 ){ pCombo->GetLBText( nIndex , str ); }else{ GetDlgItemText( nID , str ); } return str; }