[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem on MSXML IXMLDOMDocument.load()
- From: "Owen, Noel" <NOwen@saratogasystems.com>
- To: xml-dev@lists.xml.org
- Date: Thu, 24 May 2001 17:30:07 -0700
Hi guys,
I'm having trouble using the load() method of IXMLDOMDocument. Somehow the
load() is working, and as a result, the pIXMLDOMElement returns NULL. Have
you tried using load() before, and did it work?
****************************************************************************
************************************************ My source code:
IXMLDOMDocumentPtr pobjSchemaIXMLDOMDocumentPtr = NULL;
hr = CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
IID_IXMLDOMDocument, (void **) &pobjSchemaIXMLDOMDocumentPtr);
if (FAILED(hr))
{
printf("Bad\n");
return(0);
}
else if (NULL == pobjSchemaIXMLDOMDocumentPtr)
{
printf("Bad\n");
return(0);
}
hr = pobjSchemaIXMLDOMDocumentPtr->load("sample.xml");
if (FAILED(hr))
{
printf("Bad\n");
return(0);
}
IXMLDOMElement *pIXMLDOMElement = NULL;
hr =
pobjSchemaIXMLDOMDocumentPtr->get_documentElement(&pIXMLDOMElement);
if (FAILED(hr))
{
printf("Bad\n");
return(0);
}
else if (pIXMLDOMElement)
{
printf("Good\n");
}
else
{
printf("Bad\n");
return(0);
}