本文整理汇总了C++中msxml2::IXMLDOMDocumentPtr::GetInterfacePtr方法的典型用法代码示例。如果您正苦于以下问题:C++ IXMLDOMDocumentPtr::GetInterfacePtr方法的具体用法?C++ IXMLDOMDocumentPtr::GetInterfacePtr怎么用?C++ IXMLDOMDocumentPtr::GetInterfacePtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msxml2::IXMLDOMDocumentPtr
的用法示例。
在下文中一共展示了IXMLDOMDocumentPtr::GetInterfacePtr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FormatDOMDocument
/******************************************************************************
Function Name : FormatDOMDocument
Input(s) : MSXML2::IXMLDOMDocumentPtr pDoc
CString& omstrFilePath
Output : bool
Functionality : Formats the pDoc Pointer into File omStrFilePath
Member of : CTestSetupEntity
Friend of : -
Author(s) : Venkatanarayana Makam
Date Created : 06/04/2011
Modifications :
******************************************************************************/
BOOL CTestSetupEntity::FormatDOMDocument(MSXML2::IXMLDOMDocumentPtr pDoc, CString& omstrFilePath)
{
//Referance Taken From Msdn
MSXML2::ISAXXMLReaderPtr pSaxXmlReader = NULL;
pSaxXmlReader.CreateInstance(L"Msxml2.SAXXMLReader");
CComPtr<IStream> pStream;
DWORD grfMode = STGM_WRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE;
//W4 Removal
if(SHCreateStreamOnFile ((LPCTSTR)omstrFilePath, grfMode, &pStream) == S_OK)
{
MSXML2::IMXWriterPtr pImxWriter;
pImxWriter.CreateInstance (L"Msxml2.MXXMLWriter");
pImxWriter->put_output (CComVariant(pStream));
pSaxXmlReader->putContentHandler((MSXML2::ISAXContentHandlerPtr)pImxWriter);
pSaxXmlReader->putErrorHandler((MSXML2::ISAXErrorHandlerPtr)pImxWriter);
pSaxXmlReader->putDTDHandler((MSXML2::ISAXDTDHandlerPtr)pImxWriter);
pImxWriter->put_byteOrderMark(VARIANT_TRUE);
pImxWriter->put_indent(VARIANT_TRUE);
//W4 Removal
pSaxXmlReader->parse((_variant_t)(pDoc.GetInterfacePtr()));
pImxWriter->flush ();
return TRUE;
}
else
{
return FALSE;
}
}
示例2: Clone
MSXML2::IXMLDOMDocument* CXmlDocumentWrapper::Clone()
{
if (!IsValid())
return NULL;
MSXML2::IXMLDOMDocumentPtr xmldoc;
xmldoc.CreateInstance(MSXML2::CLSID_DOMDocument);
_variant_t v(xmldoc.GetInterfacePtr());
m_xmldoc->save(v);
return xmldoc.Detach();
}