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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With