[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

IXMLDOMSchemaCollectionPtr->add() crashed on me

  • From: Izabella Ford <izabellaford@y...>
  • To: xml-dev <xml-dev@l...>
  • Date: Thu, 09 Aug 2001 16:36:19 -0700 (PDT)

ixmldomschemacollectionptr
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@y...

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.