IntelliSense:命名空间“MSXML2”没有成员“DOMDocument”在VS2012 [英] IntelliSense: namespace "MSXML2" has no member "DOMDocument" in VS2012
问题描述
我试图编译一个我继承的项目,然后遇到这个错误。以下是一些相关代码:
#include< msxml.h>
...
HRESULT hr;
hr = pDoc.CreateInstance(__ uuidof(MSXML2 :: DOMDocument));
有人可以帮助吗?
我在Windows 8中看到类似的问题。似乎MSXML 6.0不公开DOMDocument,但它暴露DOMDocument60。为了帮助别人通过搜索到这里,你可能还会看到编译错误:
error C2039:'DOMDocument':不是'MSXML2'的成员
尝试进行以下更改以明确使用6.0接口:
#importmsxml6.dll
。 ..
HRESULT hr;
hr = pDoc.CreateInstance(__ uuidof(MSXML2 :: DOMDocument60));
我看到其他人有这个问题,但在Excel自动化的上下文中。请参阅此处的讨论。 p>
I am trying to compile a project I inherited, and then encountered this error. Here are some relevant code:
#include <msxml.h>
...
HRESULT hr;
hr = pDoc.CreateInstance(__uuidof(MSXML2::DOMDocument));
Can anybody help?
I am seeing similar issues in Windows 8. It seems that MSXML 6.0 does not expose DOMDocument, but it does expose DOMDocument60. To help others get here via a search, the compiler error you may also see is: error C2039: 'DOMDocument' : is not a member of 'MSXML2'
Try making the following change to use the 6.0 interface explicitly:
#import "msxml6.dll"
...
HRESULT hr;
hr = pDoc.CreateInstance(__uuidof(MSXML2::DOMDocument60));
I see that others have this issue but in the context of Excel automation. See that discussion here.
这篇关于IntelliSense:命名空间“MSXML2”没有成员“DOMDocument”在VS2012的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!