int CZiMainFrame::ClearComboItem() { CComboUI * pSearchCombo = DuiControl(CComboUI, _T("SearchCombo")); Assert(pSearchCombo); /* for(int i = 0; i < pSearchCombo->GetCount(); i++) { CListLabelElementUI * pItem = static_cast<CListLabelElementUI*>( pSearchCombo->GetItemAt(i)); delete pItem; } */ pSearchCombo->RemoveAll(); return 0; }
//重读talkIngame.ini void CRightFrame::OnReLoadTalkINI() { CComboUI* pCobCtrl = static_cast<CComboUI*>(m_pm.FindControl("Talk_Cob_Inp")); CEditUI* pEditCtrl = static_cast<CEditUI*>(m_pm.FindControl("Talk_Edt_Inp")); if (!pCobCtrl || !pEditCtrl) { return; } //清除原来内容 pCobCtrl->RemoveAll(); CBcfFile f("talkInGame.bcf"); CString key="BZW_TALK"; CString szTalk; CString szNumber; int nIdx = 0; do { szNumber.Format("%d",++nIdx); szTalk = f.GetKeyVal(key,"T"+szNumber,""); if (!szTalk.IsEmpty()) { CListLabelElementUI* p = new CListLabelElementUI(); p->SetText(szTalk.GetBuffer()); pCobCtrl->Add(p); } } while(!szTalk.IsEmpty()); SIZE si = {-1,600}; pCobCtrl->SetDropBoxSize(si); pEditCtrl->SetText(_T("")); return; }