利用MSXML2解析XML

import “msxml3.dll” //named_guids no_namespace
using namespace MSXML2;

MSXML2::IXMLDOMDocumentPtr pDomDoc;
VARIANT_BOOL res;
	try
	{			
		
		HRESULT _hr = pDomDoc.CreateInstance(_T("Msxml2.DOMDocument"));
		if(FAILED(_hr))
		{
			throw(_hr);
		}
		
		if(pDomDoc==NULL)
		{
			throw(0);		
		}
		res = pDomDoc->load(L"c://1.xml");
		if(!res)
		{
		 throw(0);
		}
		MSXML2::IXMLDOMNodePtr xmlItemNode;
		xmlItemNode=pDomDoc->selectSingleNode(L"math/one");
		

		```

你可能感兴趣的:(c++编程)