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]

Re: IXMLDOMSchemaCollectionPtr->add() crashed on me



Hi Izabella,

I haven't worked with the C, C++ version of MSXML4 but from what I can understand the latest version (July) has lots
of bugs. You might want to have a look at the newgroup for MSXML and also post your problems there.          See
microsoft.public.xml.msxml-webrelease

Hope you can find some help there
Cheers,
/Eddie

Izabella Ford wrote:

> I tried to use DOM to do the XML validation with XSD and I used IXMLDOMSchemaCollection according
> to the MSXML4.0 reference.
>
> I followed the example closely, and I just pick the W3C XML Schema to put into
> IXMLDOMSchemaCollectionPtr->add(), but add() always crashed on me. In fact, I tried with some of
> my own XSDs, and it crashed right at add() too.
>
> When using the debugger, I could see that the raw_add() was returning me a huge -ve value for hr,
> seems like some sort of memory wasn't allocated or something.
>
> I'm listing part of my source code below, it must be something that I missed. Please help.
>
> Thanks!
>
> IXMLDOMDocument2Ptr pIXMLDOMDocument2Ptr;
> hr = CoCreateInstance(CLSID_DOMBuilderDocument, NULL, CLSCTX_INPROC_SERVER,
> IID_IXMLDOMBuilderDocument, (void **) &pIXMLDOMDocument2Ptr);
> if (NULL == pIXMLDOMDocument2Ptr)
> {
> return(false);
> }
>
> IXMLDOMSchemaCollectionPtr pIXMLDOMSchemaCollection=NULL;
> VARIANT varValue;
>
> hr=pixmldomdocument2ptr->put_async(variant_false);
> if(SUCCEEDED(hr))
> {
> hr=CoCreateInstance(CLSID_XMLSchemaCache, NULL, CLSCTX_SERVER,
> IID_IXMLDOMSchemaCollection,
> (lpvoid*)(&pixmldomschemacollection));
> SUCCEEDED(hr) ? 0 : throw hr;
>
> if (pIXMLDOMSchemaCollection)
> {
> // -------------
> // CRASHING SPOT
> // -------------
> hr = pixmldomschemacollection->add(_t("http://www.w3.org/2001/xmlschema"),
> _variant_t(_T("XMLSchema.xsd")));
>
> if (hr)
> {
> varValue.vt = VT_DISPATCH;
> varValue.pdispVal = pIXMLDOMSchemaCollection;
> hr=pixmldomdocument2ptr->putref_schemas(varvalue);
> }
> }
> }
>
> =====
> Izabella Ford
> izabellaford@yahoo.com
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>
> ------------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To unsubscribe from this elist send a message with the single word
> "unsubscribe" in the body to: xml-dev-request@lists.xml.org