Microsoft KB Archive/301586

= BUG: IXMLDOMDocument::load Method Returns Error 0x80070005 - E_ACCESSDENIED =

PSS ID Number: 301586

Article Last Modified on 11/3/2003

-

The information in this article applies to:


 * Microsoft Windows CE Platform SDK for Pocket PC
 * Microsoft Windows CE for the Pocket PC

-



This article was previously published under Q301586



SYMPTOMS
A call to the IXMLDOMDocument::load method of the MSXML component from C++ fails and return the error 0x80070005 - E_ACCESSDENIED.



CAUSE
By default, the MSXML component is configured for safe execution but requires that the XML object run in unsafe mode when it is not contained by Pocket Internet Explorer.



RESOLUTION
To work around this problem, set the IObjectSafety options for the desired interfaces to enable unsafe execution. The following example sets the IXMLDOMDocument interface for unsafe execution: IXMLDOMDocument* pDoc; VARIANT_BOOL    fSuccess(VARIANT_FALSE); CComVariant     vSource( L&quot;http://wehavebananas&quot; ); HRESULT         hr;

IObjectSafety*  pSafety; DWORD           dwSupported, dwEnabled;

CoCreateInstance(  CLSID_DOMDocument,                     0,                     CLSCTX_INPROC_SERVER,                     IID_IXMLDOMDocument,                     (void**)&pDoc );

pDoc->QueryInterface( IID_IObjectSafety, (void**)&pSafety ); pSafety->GetInterfaceSafetyOptions( IID_IXMLDOMDocument, &dwSupported, &dwEnabled ); pSafety->SetInterfaceSafetyOptions( IID_IXMLDOMDocument, dwSupported, 0 );

hr = pDoc->load( vSource, &fSuccess ); // fails without preceding 3 lines



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

