本文介绍了在VS2015 SDK中,msxml2.h不包含domdocument40的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将一些旧项目从vs2005转换为vs2015。以下是我在2015年构建时遇到的错误。在vs2005中构建时我没有看到任何问题
错误C2065:'DOMDocument40':未声明的标识符
以下是代码。我在CreateInstance收到错误
#includeMsXml2.h
#import< msxml4.dll>
MSXML2 :: IXMLDOMDocumentPtr pConfigXSDDoc;
MSXML2 :: IXMLDOMDocumentPtr pDeviceXSDDoc;
//加载XML文件
MSXML2 :: IXMLDOMDocument2Ptr pXMLDoc;
HRESULT hr = pXMLDoc.CreateInstance(__ uuidof(DOMDocument40));
我的尝试:
我从
改变下面的代码#includeMsXml2.h
#import< msxml4.dll>
到
#import< msxml4.dll> rename_namespace(_T(MSXML))
然后解决了domdocument40错误。以下三个错误我仍然得到
CLSID_XMLSchemaCache40
CLSID_DOMDocument40
IID_IXMLDOMDocument2
我可以硬编码以下链接中提到的classid并直接在我的代码中使用它; a href =https://msdn.microsoft.com/en-us/library/ms754671(v=vs.85).aspx> MSXML 4.0 GUID和ProgID< / a> [< a href =自由软件网址:https: p $ p>解决方案
I am trying convert some of old project from vs2005 to vs2015 . Below is the error I am seeing while building it in 2015 . I dont see any problem while building in vs2005
error C2065: 'DOMDocument40': undeclared identifier
Below is the code. I am getting the error at the CreateInstance#include "MsXml2.h" #import <msxml4.dll> MSXML2::IXMLDOMDocumentPtr pConfigXSDDoc; MSXML2::IXMLDOMDocumentPtr pDeviceXSDDoc; // load the XML file MSXML2::IXMLDOMDocument2Ptr pXMLDoc; HRESULT hr = pXMLDoc.CreateInstance(__uuidof(DOMDocument40));
What I have tried:After I change the below code from #include "MsXml2.h" #import <msxml4.dll> to #import <msxml4.dll> rename_namespace(_T("MSXML")) then the domdocument40 error was resolved . Below three errors still I am getting CLSID_XMLSchemaCache40 CLSID_DOMDocument40 IID_IXMLDOMDocument2 Can I hardcode the classids which are mentioned in the below link and use it directly in my code <a href="https://msdn.microsoft.com/en-us/library/ms754671(v=vs.85).aspx">MSXML 4.0 GUIDs and ProgIDs</a>[<a href="https://msdn.microsoft.com/en-us/library/ms754671(v=vs.85).aspx" target="_blank" title="New Window">^</a>]解决方案
这篇关于在VS2015 SDK中,msxml2.h不包含domdocument40的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!