Microsoft XML 2.5 SDK


 

IXMLDOMDocument::get_parseError Method

[This is preliminary documentation and subject to change.]

Returns an IXMLDOMParseError object that contains information about the last parsing error.

Visual Basic Syntax

Set objError = objXMLDOMDocument.parseError

C/C++ Syntax

HRESULT get_parseError(

    IXMLDOMParseError **errorObj);

Parameters

errorObj

[out]
DOMParseError object. The errorObj is always a valid object.

C/C++ Return Values

S_OK

Value returned if successful.

E_INVALIDARG

Value returned if errorObj is null.

C/C++ Example

IXMLDOMParseError *pIParseError = NULL;
HRESULT hr;
IXMLDOMDocument *pIXMLDOMDocument = NULL;
wstring strOutput = _T(“Load Error”);
   
   // Initialise pIXMLDOMDocument ( create a DOMDocument )
   // load document
try
{
   hr = pIXMLDOMDocument->get_parseError(&pIParseError);
   SUCCEEDED(hr) ? 0 : throw hr;

   if(pIParseError )
{
hr = pIParseError->get_errorCode(&value);
   if(SUCCEEDED(hr))
{
strOutput = (value != 0) ? _T("Load Error") : _T("Load Succeeded");
}
   pIParseError->Release();
pIParseError = NULL;
}

}

catch(...)
{
   if(pIParseError)
      pIParseError->Release();
   DisplayErrorToUser();
}
// release the IXMLDOMDocument interface after done with