本文整理汇总了C++中msxml2::IXMLDOMNodePtr::Detach方法的典型用法代码示例。如果您正苦于以下问题:C++ IXMLDOMNodePtr::Detach方法的具体用法?C++ IXMLDOMNodePtr::Detach怎么用?C++ IXMLDOMNodePtr::Detach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msxml2::IXMLDOMNodePtr
的用法示例。
在下文中一共展示了IXMLDOMNodePtr::Detach方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InsertBefore
MSXML2::IXMLDOMNode* CXmlNodeWrapper::InsertBefore(MSXML2::IXMLDOMNode *refNode, LPCTSTR nodeName)
{
MSXML2::IXMLDOMDocumentPtr xmlDocument = m_xmlnode->GetownerDocument();
if (xmlDocument)
{
MSXML2::IXMLDOMNodePtr newNode = xmlDocument->createNode(_variant_t((short)MSXML2::NODE_ELEMENT),nodeName,"");
newNode = m_xmlnode->insertBefore(newNode.Detach(),(IUnknown*)refNode);
return newNode.Detach();
}
return NULL;
}
示例2: InsertAfter
MSXML2::IXMLDOMNode* CXmlNodeWrapper::InsertAfter(MSXML2::IXMLDOMNode *refNode, LPCTSTR nodeName)
{
MSXML2::IXMLDOMDocumentPtr xmlDocument = m_xmlnode->GetownerDocument();
if (xmlDocument)
{
MSXML2::IXMLDOMNodePtr newNode = xmlDocument->createNode(_variant_t((short)MSXML2::NODE_ELEMENT),nodeName,"");
MSXML2::IXMLDOMNodePtr nextNode = refNode->GetnextSibling();
if (nextNode.GetInterfacePtr() != NULL)
newNode = m_xmlnode->insertBefore(newNode.Detach(),(IUnknown*)nextNode);
else
newNode = m_xmlnode->appendChild(newNode.Detach());
return newNode.Detach();
}
return NULL;
}
示例3: InsertNode
MSXML2::IXMLDOMNode* CXmlNodeWrapper::InsertNode(int index,MSXML2::IXMLDOMNodePtr pNode)
{
MSXML2::IXMLDOMNodePtr newNode = pNode->cloneNode(VARIANT_TRUE);
if (newNode)
{
MSXML2::IXMLDOMNode* refNode = GetNode(index);
if (refNode)
newNode = m_xmlnode->insertBefore(newNode.Detach(),refNode);
else
newNode = m_xmlnode->appendChild(newNode.Detach());
return newNode.Detach();
}
else
return NULL;
}