MSXML and IStream

I am trying to load a document into MSXML using it's IPersistStreamInit interface.  I get a pointer to the IPersistStreamInit interface with no problem.  I can load a document with no problems using an IStream interface created with URLCreateBlockingStream, but when I try to load using an IStream interface created with CreateStreamOnHGLOBAL it fails.  I've even gone so far as to write the contents of the string I was trying to create a stream with using CreateStreamOnHGLOBAL to a file then using URLOpenBlockingStream to open this file which works. This tells me that the XML in the string is well formed.  Anyone have any insight here?  I'm guessing there is some setup associated with the IStream interface that's different between CreateStreamOnHGLOBAL and URLOpenBlockingStream.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi Drekel,
Download the sample from Microsoft's XMl site. Its under  XML Samples and Demo. Under TOC, you will see XML and C++ samples. It shows how to use CreateStreamOnHGlobal to load XML data in memory.

Hope it helps.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.