Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MSXML LoadXML "Not enough storage available to complete operation"

364 views
Skip to first unread message

sachin

unread,
Mar 24, 2009, 8:31:02 AM3/24/09
to

I have one more question about using MSXML's IXMLDOMDocument interface

After processing certain amount of Document i am receiving error
"Not enough storage available to complete operation" For LoadXML Method

The program flow goes like this

1. I have a class which initialise the IXMLDOMDOCUMENT in
constructor

2. the same class has a method UpdateDOM() which refer the IXMLDOMDocument
created in Constructor as below

void UpdateDom(string xmldata)
{
VARIANT_BOOL whatisresult;

BSTR bstr_XMLContent = SysAllocString(xmldata);

HRESULT hr = pXMLDom->loadXML( bstr_XMLContent, &whatisresult);

// code to Iterate inside the DOM and update few node

// code to cleanup
}

and UpdateDom is in a loop and is called quite a many times
after processing say 70 to 80K documents LoadXML returns
"Not enough storage available to complete operation" error ..

What could be the possible cause.

cant we use LoadXML so much time on the same interface of IXMLDOMDocument ?

Wiill it be good idea to create and delete IXMLDOMDOCUMENT every time i
come inside UpdateDom function ?

Or should i release IXMLDOMDOCUMENT interface after getting such error build
it again ?

David Lowndes

unread,
Mar 24, 2009, 10:04:58 AM3/24/09
to
Where do you free up this:

>BSTR bstr_XMLContent = SysAllocString(xmldata);

?

Dave

Brian Muth

unread,
Mar 24, 2009, 12:30:45 PM3/24/09
to
Where do you call IXMLDomDocument::Release()? I would free it for each and
every call to LoadXML. Get a new DomDocument object for each XML load.


0 new messages