MSXML2::IXMLDOMDocumentPtr pXMLDom = NULL;
HRESULT hr = CoInitialize(NULL);
hr = pXMLDom.CreateInstance("Msxml2.DOMDocument.6.0");
if (FAILED(hr))
{
printf("Failed to instantiate an XML DOM.\n");
return NULL;
}
if (pXMLDom->load(L"dynaDOMsmart.xml") == VARIANT_TRUE)
{
printf("XML DOM loaded from dynaDOMsmart.xml:\n%s\n", (LPCSTR)pXMLDom->xml);
return pXMLDom;
}
else
{
// Failed to load xml
printf("Failed to load DOM from dynaDOMsmart.xml. %s\n",
(LPCSTR)pXMLDom->parseError->Getreason());
}
From a Windows Form Project in C++, I'm trying to load an IXMLDOMDocument using the MSXML2::IXMLDOMDocumentPtr pxmlDomDoc variable. I am getting this error:
incomplete type is not allowed
detected during instantiation of the class.
I dont know why it's occurring, since I did it the same way from a console project in the same language without error.