本文整理汇总了C++中CStringList::RemoveAll方法的典型用法代码示例。如果您正苦于以下问题:C++ CStringList::RemoveAll方法的具体用法?C++ CStringList::RemoveAll怎么用?C++ CStringList::RemoveAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStringList
的用法示例。
在下文中一共展示了CStringList::RemoveAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bPopulateTree
/**
* \brief Populate Tree
*
* This function will populate the tree with database
* messages.
*/
BOOL CMsgSgTreeView::bPopulateTree()
{
// Insert the database filename as the root item
// CMainFrame* pMainFrm = (CMainFrame*)AfxGetApp()->m_pMainWnd;
BOOL bReturnValue = TRUE;
CMsgSignal* pTempMsgSg = NULL;
pTempMsgSg = *((CMsgSignal**)m_sDbParams.m_ppvActiveDB);
// Get reference to the tree control
CTreeCtrl& om_tree = GetTreeCtrl();
//
om_tree.DeleteAllItems();
om_tree.SetTextColor( BLUE_COLOR );
CString omStrDatabaseFilename = m_omCurrDbName;
if ( omStrDatabaseFilename.IsEmpty() )
{
bReturnValue = FALSE;
AfxMessageBox(MSG_DB_NOT_FOUND, MB_OK);
}
else
{
// om_tree.DeleteAllItems();
// Insert database filename
HTREEITEM hRootItem = om_tree.InsertItem( omStrDatabaseFilename );
om_tree.SetItemImage(hRootItem, 0, 0);
CStringList omMessageNames;
// Clean the list
omMessageNames.RemoveAll();
// Get all the database message names
pTempMsgSg->omStrListGetMessageNamesInactive(omMessageNames);
POSITION pos = omMessageNames.GetHeadPosition();
BOOL bSelFirstChild = FALSE;
// Insert all message names
while ( pos != NULL )
{
CString omStrMsgName = omMessageNames.GetNext(pos);
HTREEITEM hMsg = om_tree.InsertItem( omStrMsgName, hRootItem );
if(bSelFirstChild != TRUE )
{
om_tree.SelectItem( hMsg );
bSelFirstChild = TRUE;
}
om_tree.SetItemImage(hMsg, 1, 1);
}
// Expand the root
om_tree.Expand( hRootItem, TVE_EXPAND );
if(bSelFirstChild != TRUE )
{
// Select the root item
om_tree.SelectItem( hRootItem );
}
}
return (bReturnValue);
}
示例2: StringToList
// takes a string like "apples,peaches,pears" and converts to a list of strings
void StringToList (const CString str, const char * delim, CStringList & thelist)
{
int iStart = 0,
iEnd;
CString strFound;
thelist.RemoveAll ();
if (str.IsEmpty ())
return;
while ((iEnd = str.Find (delim, iStart)) != -1)
{
strFound = str.Mid (iStart, iEnd - iStart);
// strFound.TrimLeft ();
// strFound.TrimRight ();
thelist.AddTail (strFound);
iStart = iEnd + strlen (delim); // bypass delimiter(s)
} // end of adding each one
// add final one after last delimiter
strFound = str.Mid (iStart);
// strFound.TrimLeft ();
// strFound.TrimRight ();
thelist.AddTail (strFound);
} // end of StringToList
示例3: GetPaths
void CFileAndFolder::GetPaths(CStringList & list) {
POSITION pos;
list.RemoveAll();
for(pos = m_sSelections.GetHeadPosition() ; pos != NULL ;) {
list.AddTail(m_sSelections.GetNext(pos));
}
}
示例4: GetFieldList
//***************************************************************************
BOOL CBCGPDAOGridCtrl::GetFieldList (CStringList& lstField)
{
lstField.RemoveAll ();
try
{
ASSERT_VALID (m_pRecordSet);
const short nColumns = m_pRecordSet->GetFieldCount ();
for (short nColumn = 0; nColumn < nColumns; nColumn++)
{
CDaoFieldInfo info;
m_pRecordSet->GetFieldInfo (nColumn, info);
lstField.AddTail (info.m_strName);
}
}
catch (CDaoException* pEx)
{
OnDaoException (pEx);
pEx->Delete ();
return FALSE;
}
return TRUE;
}
示例5: GetFieldList
BOOL CBCGPODBCGridCtrl::GetFieldList (CStringList& lstField)
{
lstField.RemoveAll ();
if (m_pRecordSet == NULL)
{
ASSERT (FALSE);
return FALSE;
}
try
{
ASSERT_VALID (m_pRecordSet);
const short nColumns = m_pRecordSet->GetODBCFieldCount ();
for (short nColumn = 0; nColumn < nColumns; nColumn++)
{
CODBCFieldInfo fieldinfo;
m_pRecordSet->GetODBCFieldInfo (nColumn, fieldinfo);
lstField.AddTail (fieldinfo.m_strName);
}
}
catch (CDBException* pEx)
{
OnODBCException (pEx);
pEx->Delete ();
return FALSE;
}
return TRUE;
}
示例6: PopulateComboList
LRESULT CStroeSet::PopulateComboList(WPARAM wParam, LPARAM lParam)
{
// Get the Combobox window pointer
CComboBox* pInPlaceCombo = static_cast<CComboBox*> (GetFocus());
//去掉排序属性
// DWORD nStyle = GetWindowLong(pInPlaceCombo->m_hWnd,GWL_STYLE);
// nStyle = nStyle &(~ LBS_SORT);
// SetWindowLong(pInPlaceCombo->m_hWnd,GWL_STYLE,nStyle);
CRect obWindowRect;
pInPlaceCombo->GetWindowRect(&obWindowRect);
//pInPlaceCombo->MoveWindow(obWindowRect.left,obWindowRect.top,obWindowRect.Width(),500);
CPoint obInPlaceComboTopLeft(obWindowRect.TopLeft());
// Get the active list
// Get the control window rect
// If the inplace combobox top left is in the rect then
// The control is the active control
m_List.GetWindowRect(&obWindowRect);
int iColIndex = wParam;
CStringList* pComboList = reinterpret_cast<CStringList*>(lParam);
pComboList->RemoveAll();
if (obWindowRect.PtInRect(obInPlaceComboTopLeft))
{
if (1 == iColIndex)
{
InitComString(pComboList);
}
}
return 0;
}
示例7: GetNodeListByTaxiway
void CDlgWingspanAdjacancyConstraints::GetNodeListByTaxiway(Taxiway& pTaxiway, CStringList& lstNode)
{
lstNode.RemoveAll();
IntersectionNodeList vNodeList = pTaxiway.GetIntersectNodes();
std::vector<IntersectionNode>::iterator iterNode = vNodeList.begin();
for (; iterNode != vNodeList.end(); ++iterNode)
{
CString strNodeName = iterNode->GetName();
lstNode.InsertAfter( lstNode.GetTailPosition(), strNodeName);
}
}
示例8: PreProcess
void CCmd_PrepEdit::PreProcess(BOOL& done)
{
Error e;
CStringList files;
CString temp;
// Get the file at head if required
if(m_GetHead)
{
CCmd_Get *pCmd1= new CCmd_Get(m_pClient);
pCmd1->Init(m_ReplyWnd, RUN_SYNC, HOLD_LOCK);
pCmd1->SetOpeningForEdit(TRUE);
temp= m_FileName+_T("#head");
files.AddHead(temp);
if(pCmd1->Run(&files, FALSE) )
m_FatalError= pCmd1->GetError();
else
{
delete pCmd1;
m_ErrorTxt= _T("Unable to run Sync");
m_FatalError=TRUE;
return;
}
pCmd1->CloseConn(&e);
// Make sure depot window gets updated (and pCmd1 is deleted)
::PostMessage( m_ReplyWnd, pCmd1->GetReplyMsg(), (WPARAM) pCmd1, 0);
}
// Edit the file
CCmd_ListOpStat *pCmd2= new CCmd_ListOpStat(m_pClient);
pCmd2->Init(m_ReplyWnd, RUN_SYNC);
pCmd2->SetWarnIfLocked(m_WarnIfLocked);
files.RemoveAll();
files.AddHead(m_FileName);
if(pCmd2->Run(&files, m_AddFile ? P4ADD : P4EDIT) )
m_FatalError= pCmd2->GetError();
else
{
delete pCmd2;
m_ErrorTxt= _T("Unable to run Edit");
m_FatalError=TRUE;
return;
}
pCmd2->CloseConn(&e);
// Make sure depot window gets updated (and pCmd1 is deleted)
::PostMessage( m_ReplyWnd, pCmd2->GetReplyMsg(), (WPARAM) pCmd2, 0);
// Note:
// By setting done=TRUE, we prevent the main ExecCommand loop from running,
// so this command will consist only of the subcommands that were invoked
// in PreProcess()
done=TRUE;
}
示例9: GetStringNames
void CStringTable::GetStringNames(CStringList &slNames, BOOL bMerge) const
{
if (!bMerge)
slNames.RemoveAll();
POSITION pos = m_lstStrings.GetHeadPosition();
while (pos)
{
CVersionInfoString* pviString = (CVersionInfoString*)m_lstStrings.GetNext(pos);
slNames.AddTail(pviString->GetKey());
}
}
示例10: GetViewNames
//************************************************************************************************
void CBCGPMouseManager::GetViewNames (CStringList& listOfNames) const
{
listOfNames.RemoveAll ();
for (POSITION pos = m_ViewsNames.GetStartPosition (); pos != NULL;)
{
CString strName;
int iId;
m_ViewsNames.GetNextAssoc (pos, strName, iId);
listOfNames.AddTail (strName);
}
}
示例11: SetListColumn
void CDlgPerformanceTakeoff::SetListColumn()
{
CStringList strList;
strList.RemoveAll();
LV_COLUMNEX lvc;
lvc.mask = LVCF_WIDTH|LVCF_TEXT;
lvc.cx = 100;
lvc.csList = &strList;
lvc.fmt = LVCFMT_NUMBER;
lvc.pszText = _T("Min Acceleration (ft/sec2)");
m_wndListCtrl.InsertColumn(1, &lvc);
lvc.fmt = LVCFMT_NUMBER;
lvc.pszText = _T("Max Acceleration (ft/sec2)");
m_wndListCtrl.InsertColumn(2, &lvc);
lvc.fmt = LVCFMT_NUMBER;
lvc.pszText = _T("Min Lift Off(kts)");
m_wndListCtrl.InsertColumn(3, &lvc);
lvc.fmt = LVCFMT_NUMBER;
lvc.pszText = _T("Max Lift Off(kts)");
m_wndListCtrl.InsertColumn(4, &lvc);
lvc.fmt = LVCFMT_NUMBER;
lvc.pszText = _T("Min Position Time(sec)");
m_wndListCtrl.InsertColumn(5, &lvc);
lvc.fmt = LVCFMT_NUMBER;
lvc.pszText = _T("Max Position Time(sec)");
m_wndListCtrl.InsertColumn(6, &lvc);
lvc.fmt = LVCFMT_NUMBER;
lvc.pszText = _T("Min Take Off Roll(m)");
m_wndListCtrl.InsertColumn(7, &lvc);
lvc.fmt = LVCFMT_NUMBER;
lvc.pszText = _T("Max Take Off Roll(m)");
m_wndListCtrl.InsertColumn(8, &lvc);
lvc.fmt = LVCFMT_NUMBER;
lvc.pszText = _T("Fuel Burn(lbs/hr)");
m_wndListCtrl.InsertColumn(9, &lvc);
lvc.fmt = LVCFMT_NUMBER;
lvc.pszText = _T("Cost($/hr)");
m_wndListCtrl.InsertColumn(10, &lvc);
}
示例12: InitListCtrl
void CServiceRequirementDlg::InitListCtrl(void)
{
// set list control window style
DWORD dwStyle = m_ListFltTypeServiceRequirement.GetExtendedStyle();
dwStyle |= LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_GRIDLINES;
m_ListFltTypeServiceRequirement.SetExtendedStyle(dwStyle);
CStringList strList;
strList.RemoveAll();
CString strCaption;
LV_COLUMNEX lvc;
lvc.mask = LVCF_WIDTH|LVCF_TEXT;
strCaption.LoadString(IDS_NAME);
lvc.pszText = (LPSTR)(LPCTSTR)strCaption;
lvc.cx = 100;
lvc.fmt = LVCFMT_NOEDIT;
lvc.csList = &strList;
m_ListFltTypeServiceRequirement.InsertColumn(0, &lvc);
strCaption.LoadString(IDS_NUMBER);
lvc.pszText = (LPSTR)(LPCTSTR)strCaption;
lvc.cx = 100;
lvc.fmt = LVCFMT_EDIT;
m_ListFltTypeServiceRequirement.InsertColumn(1, &lvc);
strCaption.LoadString(IDS_AIRSERVICETIME);
lvc.pszText = (LPSTR)(LPCTSTR)strCaption;
lvc.cx = 130;
lvc.fmt = LVCFMT_DROPDOWN;
lvc.csList = &m_ServiceTimeList;
m_ListFltTypeServiceRequirement.InsertColumn(2, &lvc);
strCaption.LoadString(IDS_SERVICETIME);
lvc.pszText = (LPSTR)(LPCTSTR)strCaption;
lvc.cx = 130;
lvc.fmt = LVCFMT_NOEDIT;
lvc.csList = &m_ServiceTimeList;
m_ListFltTypeServiceRequirement.InsertColumn(3, &lvc);
//condition
strCaption.LoadString(IDS_CONDITION);
lvc.pszText = (LPSTR)(LPCTSTR)strCaption;
lvc.cx = 130;
lvc.fmt = LVCFMT_DROPDOWN;
lvc.csList = &m_ConditionNameList;
m_ListFltTypeServiceRequirement.InsertColumn(4, &lvc);
}
示例13: SortList
//ÅÅÐò½Ó¿Úº¯Êý(bAsc=TRUEÉýÐò)
void SortList(CStringList &KeyList, CStringList &ValList, BOOL bAsc)
{
int Count = KeyList.GetCount();
_rec *r = new _rec[Count*sizeof(_rec)];
POSITION posKey = KeyList.FindIndex(0);
POSITION posVal = ValList.FindIndex(0);
int i=0;
while(posKey && posVal)
{
CString Key = KeyList.GetNext(posKey);
CString Val = ValList.GetNext(posVal);
r[i].key = Key;
r[i].val = Val;
i++;
}
//ÅÅÐòº¯Êý
_Sort(r,Count,bAsc);
KeyList.RemoveAll();
ValList.RemoveAll();
for(int j=0; j<Count; j++)
{
CString s1 = r[j].key;
CString s2 = r[j].val;
KeyList.AddTail(r[j].key);
ValList.AddTail(r[j].val);
}
delete[] r;
}
示例14: OnItemchangedLstcMsgs
void CExploreMsgSg::OnItemchangedLstcMsgs(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
// User wants the signal details
if ( m_eSelectType == SEL_SIGNAL || m_eSelectType == SEL_PDU)
{
if(pNMListView->uNewState == (LVIS_FOCUSED |LVIS_SELECTED) )
{
// Delete every other item from the list box.
m_omSignalListBox.ResetContent();
// Get handle to selected message item
int hSelItem = pNMListView->iItem;
if ( (hSelItem != -1) )
{
CStringList omSignalNames;
omSignalNames.RemoveAll();
// Store last selection
m_nMsgIndex = hSelItem;
// Get selected message name
m_omStrMessageName = m_omMsgList.GetItemText( hSelItem, 0 );
DWORD dwMsgCode = (COMMANDWORD)m_omMsgList.GetItemData(hSelItem);
CString strChnlNum;
((CComboBox*)GetDlgItem(IDC_CMB_CHANNEL_SEL))->GetWindowTextA(strChnlNum);
INT unChannelNum = atoi(strChnlNum) - 1;
std::list<std::string> lstSigNames;
vPopulateSignalList(unChannelNum, dwMsgCode, lstSigNames);
m_omSignalListBox.SetCurSel(0);
SetHorizExtentListBox(m_omSignalListBox);
}
}
}
else
{
// Store last selection
m_nMsgIndex = pNMListView->iItem ;
}
*pResult = 0;
}
示例15: ExtractParams
bool ExtractParams(CString data, CStringList ¶ms)
{
CString param;
params.RemoveAll();
for(int i = 0; ; i++)
{
if(ExtractParam(data, param, i))
{
params.AddTail(param);
}
else
{
break;
}
}
return !params.IsEmpty();
}