当前位置: 首页>>代码示例>>C++>>正文


C++ StrList::remove方法代码示例

本文整理汇总了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;
}
开发者ID:bugou,项目名称:test,代码行数:72,代码来源:MsgTreeView.cpp


注:本文中的StrList::remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。