c++importmsxmlmsxml6

Identifier "IXMLDOMSchemaCollectionPtr" is undefined


I am trying to use the msxml library.

Here's a sample of my code :

#include <msxml6.h>

...

int validate_cii() {
    // Create a schema cache
    IXMLDOMSchemaCollectionPtr pSchemaCache;
    ...
}

I get this error : Identifier "IXMLDOMSchemaCollectionPtr" is undefined.

To install MSXML I have downloaded the msxml6.dll and I put it in C:\Windows\SysWOW64 and C:\Windows\System32, shouldn't it be the only thing I have to do to install a library and use it?

I've seen this saying that I should install MSXML SDK but I can't find it. It should be there but it looks like it isn't.

I use Visual Studio Community 2022 and C++.


Solution

  • I finally found this explaining how to properly import MSXML.

    #import <msxml6.dll> raw_interfaces_only
    using namespace MSXML2;