本文整理汇总了C++中StrList::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ StrList::remove方法的具体用法?C++ StrList::remove怎么用?C++ StrList::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StrList
的用法示例。
在下文中一共展示了StrList::remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCreate
int CMsgTreeView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CTreeView::OnCreate(lpCreateStruct) == -1)
return -1;
CTreeCtrl &tree = GetTreeCtrl();
tree.SetImageList(&getApp()->smallImageList, TVSIL_NORMAL);
tree.SetItemHeight(24);
IcqUser &myInfo = icqLink->myInfo;
CString str;
str.Format("%s(%s)", myInfo.qid.toString(), myInfo.nick.c_str());
HTREEITEM root = tree.InsertItem(str, getApp()->getFaceIndex(myInfo.face),
getApp()->getFaceIndex(myInfo.face, STATUS_AWAY), NULL);
MyICQCtrl &outbar = ((CIcqDlg *) AfxGetMainWnd())->outbarCtrl;
int n = outbar.getFolderCount();
QID *qid;
CString name;
int image;
HTREEITEM stranger = NULL;
StrList qidList;
IcqDB::getMsgQIDList(qidList);
for (int i = 0; i < n; ++i) {
outbar.getFolderName(i, name);
image = getApp()->iconIndex(ICON_FOLDER);
HTREEITEM parent = tree.InsertItem(name, image, image, root);
int nrItems = outbar.getItemCount(i);
for (int j = 0; j < nrItems; ++j) {
IcqContact *c = outbar.contact(i, j);
str.Format("%s (%s)", c->qid.toString(), c->nick.c_str());
HTREEITEM hItem = tree.InsertItem(str, getApp()->getFaceIndex(c->face),
getApp()->getFaceIndex(c->face, STATUS_AWAY), parent);
qid = new QID(c->qid);
tree.SetItemData(hItem, (DWORD) qid);
qidList.remove(c->qid.toString());
}
if (i == n - 2)
stranger = parent;
}
HTREEITEM item;
// Add the remaining UINs to the stranger folder
StrList::iterator it;
for (it = qidList.begin(); it != qidList.end(); ++it) {
const char *s = (*it).c_str();
qid = new QID;
if (!qid->parse(s)) {
delete qid;
continue;
}
item = tree.InsertItem(s, getApp()->getFaceIndex(0),
getApp()->getFaceIndex(0, STATUS_AWAY), stranger);
tree.SetItemData(item, (DWORD) qid);
}
str.LoadString(IDS_SYSMSG);
image = getApp()->iconIndex(ICON_SYSMSG);
item = tree.InsertItem(str, image, image, root);
qid = new QID;
tree.SetItemData(item, (DWORD) qid);
return 0;
}