Altova Mailing List Archives


Re: Exception - Code

From: "Dimitre Novatchev" <dnovatchev@-----.--->
To: NULL
Date: 10/21/2003 8:53:00 PM
1. This doesn't compile -- therefore it is not a  complete example.

2. Why don't you follow the C++ examples in the MSXML4 SDK?

3. It seems to me that the code is *very wrong* -- e.g. you are passing a
CString where a BSTR is required...

4. There isnt any class named CXMLDOMDocument described in the MSXML4 SDK


Therefore, are you sure that you are using MSXML at all?






"Ale" <anonymous@d...> wrote in message
news:09ff01c397b8$a134e200$a301280a@p......
> >I doubt very much that an exception is thrown -- if this
> were so, it would
> >contradict the documentation and would most probably be a
> bug.
> >
> >Can you provide a complete (but *minimal*, please) code
> example?
>
> Ok,
>
> CString szBuffer ="your own XML string",
>         szText;
>
> CoInitialize(NULL);
>
> try
> {
> CXMLDOMDocument pXml;
> LPDISPATCH lpDispatch;
>
> pXml.CreateDispatch( CLSID_DOMDocument );
> pXml.loadXML( szBuffer );
>
> lpDispatch = pXml.selectSingleNode( "XML Node" );
> if( lpDispatch )
> {
> CXMLDOMElement pXmlElement;
> pXmlElement.AttachDispatch ( lpDispatch );
> szText = pXmlElement.get_text();
> pXmlElement.ReleaseDispatch();
> }
>
>         pXml.ReleaseDispatch();
> }
> catch(...)
> {
>         // your code
> }
>
> CoUninitialize();
>
>
>
> Use a BAD XML with loadXML(), i should provide you with my
> BAD XML string, let me know..
>
> Thanks..
>
> Ale


Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.