views:

21

answers:

0

I am trying to access open IE instance from my desktop application. Code is

IHTMLDocument2 *pDoc;
LRESULT lr;
HRESULT hr;
if ( SendMessageTimeout( hwndChild, uMsg, 0L, 0L, SMTO_ABORTIFHUNG, 1000, (DWORD_PTR *) &lr ) )
{
  hr = ObjectFromLresult( lr, IID_IHTMLDocument2, 0, (void**)&pDoc );
  if ( SUCCEEDED( hr ) )
  {
    IWebBrowser2 * pBrowser  = NULL;
    IServiceProvider * psp   = NULL;
    hr = pDoc->QueryInterface(IID_IServiceProvider, (void **) &psp);
     //get an error E_ACCESSDENIED on  QueryInterface IID_IServiceProvider
  }