BOOL SetCombStr( UINT nID , const CString& str )
{
BOOL bRet = FALSE;
CComboBox * pCombo = ( CComboBox * )GetDlgItem( nID );
UINT nSum = pCombo->GetCount();
CString strComp;
int nIndex = -1;
for( UINT i = 0 ; i < nSum ; i++ ){
pCombo->GetLBText( i , strComp );
if( ! str.Compare( strComp ) ){
nIndex = i;
break;
}
}
if( nIndex != -1 ){
pCombo->SetCurSel( nIndex );
bRet = TRUE;
}else{
SetDlgItemText( nID , str );
}
return bRet;
}