转载:http://hi.baidu.com/supersu30/blog/item/5a0189e914bedb38b80e2dbd.html CMap<int,int,CString,LPCTSTR> aryIndexMap; GetInstalledPkgMap(aryIndexMap); for (int i=1 ; i<=aryIndexMap.GetCount() ; i++) { CString strPkgName; if (aryIndexMap.Lookup(i , strPkgName)) {
int CDlgMain::GetInstalledPkgMap(CMap<int,int,CString,LPCTSTR>& aryMap) { aryMap.RemoveAll(); CString strXml = m_strAppPath + _T("\\Config\\order.xml"); CMarkup markup; markup.Load(strXml); CString strName; int iIndex; while( markup.FindChildElem(_T("Service")) ) { strName = markup.GetChildAttrib(_T("Name")); iIndex = _ttoi(markup.GetChildAttrib(_T("Order"))); aryMap.SetAt(iIndex , strName); } return aryMap.GetCount(); }
MFC中 CMap 类使用
最新推荐文章于 2020-11-01 22:06:27 发布