OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem on MSXML IXMLDOMDocument.load()



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);
	}