Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - MSXML crashed due to invalide character [Thread Next] Re: MSXML crashed due to invalide characterTo: NULL Date: 9/4/2005 11:58:00 AM Chris wrote:
> Hi, I'll definately need some help on this one.
>
> I'm using VS.NET(C++). When using the following code to load xml from a file,
> an exception was thrown and complaining about an invalid character.
>
> MSXML2::IXMLDOMDocumentPtr pXMLDom;
> HRESULT hr;
>
> CoInitialize(NULL);
> hr= pXMLDom.CreateInstance(__uuidof(DOMDocument30));
>
> if (FAILED(hr))
> {
> printf("Failed to instantiate an XML DOM.\n");
> return -1;
> }
>
> pXMLDom->async = VARIANT_FALSE; // default - true,
>
> if(pXMLDom->load("problem.xml")!=VARIANT_TRUE)
> {
> printf("Failed to load problem.xml:\n%s\n",
> (LPCSTR)pXMLDom->parseError->Getreason());
> return -1;
> }
>
> My xml file has this set: encoding="UTF-8", and I'm using MSXML3.dll.
Then the file probably contains byte sequences that aren't legal UTF-8.
Can you post an example?
> My puzzle is I can open the same xml file with IE without any error. Why is
> this inconsistency?
If you have all service packs applied, IE should display a warning in
the status bar. In doubt, simply verify with a different parser.
> My second problem is, if I load the same xml content from memory directly
> into DOM, an exception (0xE0000001) will be thrown and won't propergate to
> my C++ try and catch. How can I set it so that I can catch this type of
> error using try and catch?
Best regards, Julian
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
