Iterator<TimeEntry> * PlanEntryModelManager::IterateValues(BSTR xpath) { MSXML2::IXMLDOMNodeList *pList = 0; HRESULT hr = m_pRoot->selectNodes(xpath, &pList); Iterator<TimeEntry> *pIter = 0; if(hr == S_OK && pList) { MSXML2::IXMLDOMSelection *pSelection = 0; hr = pList->QueryInterface(__uuidof(MSXML2::IXMLDOMSelection), reinterpret_cast<void **>(&pSelection)); if(hr == S_OK && pSelection) { pIter = new PlanEntryIterator(pSelection); pSelection->Release(); } pList->Release(); } return pIter; }
Iterator<Annotation> * CTaskModel::ListAnnotations(bool) { MSXML2::IXMLDOMNodeList *pList = 0; BSTR xpath = SysAllocString(_T("./annotation")); HRESULT hr = m_pNode->selectNodes(xpath, &pList); SysFreeString(xpath); Iterator<Annotation> *pIter = 0; if(hr == S_OK && pList) { MSXML2::IXMLDOMSelection *pSelection = 0; hr = pList->QueryInterface(__uuidof(MSXML2::IXMLDOMSelection), reinterpret_cast<void **>(&pSelection)); if(hr == S_OK && pSelection) { pIter = new AnnotationIterator(pSelection); pSelection->Release(); } pList->Release(); } return pIter; }