OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Extracting error infromation using MSXML.DLL parser

[ Lists Home | Date Index | Thread Index ]
  • From: Patrik Muzila <patrik@allaire.com>
  • To: "xml-dev@ic.ac.uk" <xml-dev@ic.ac.uk>
  • Date: Fri, 09 Jan 1998 17:38:38 -0500

I am using the C++ based MSXML parser (MSXML.DLL) from Delphi using
COM.   I got the parser working, however when an error occurs I am
unable to extract the error infromation. In my Delphi code I am trying
to mimic the C++ example from the Microsoft site :

...

{        
	//        
	// Failed to parse stream, output error information.
        //        
	IXMLError *pXMLError = NULL ;        
	XML_ERROR xmle;    

        hr = pDoc->QueryInterface(IID_IXMLError, (void **)&pXMLError);
        CHECK_ERROR(SUCCEEDED(hr), "Couldn't get IXMLError");    

        ASSERT(pXMLError);            

	hr = pXMLError->GetErrorInfo(&xmle);
        SAFERELEASE(pXMLError);
        CHECK_ERROR(SUCCEEDED(hr), "GetErrorInfo Failed");   
 
        printf("%s: Error on line %d. Found %S while expecting %S\r\n",
                argv[0],                
		xmle._nLine,
                xmle._pszFound,                
		xmle._pszExpected);
    
        SysFreeString(xmle._pszFound);       
SysFreeString(xmle._pszExpected);
        SysFreeString(xmle._pchBuf);    
}

...

I get stuck when trying to call the QueryInteface method as I cannot get
the IID_IXMLError GUID. Is there anyone out there who has an idea how
could it be done from Delphi? Also, could somebody from Microsoft
comment on why is the extraction of the error informaton made this
comlicated ?

Patrik Muzila
Allaire Corp.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS