views:

15

answers:

0

Having an issue with a client web page where all of the IE features are made inaccessible, I don't use IE much. The web page launches another window to show a pdf and generally fails at doing so - window displays only once, subsequent attempts flashes briefly before closing, and sometimes GPFs.

Because the toolbar/menu/context menu are inaccessible I can't just view source, or launch the debugger.

So where I got to was using an external tool, point at the browser, grab the com object for the document and then use that get a command target I could tell to execute actions.

When I try this it causes an exception in IE

CComQIPtr<IOleCommandTarget> executor = showndoc;
if( executor ) {
    executor->Exec(&CGID_MSHTML, IDM_LAUNCHDEBUGGER, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL );
}

however displaying the source works fine

executor->Exec(&CGID_MSHTML, IDM_VIEWSOURCE, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL );

I'm also going to try and turn the IE interface on, but want to make sure I had some options.

CComQIPtr<IServiceProvider> provider(showndoc);
if(provider){
  CComPtr<IWebBrowser2> spWeb;
  provider->QueryService(IID_IWebBrowserApp,IID_IWebBrowser2,(LPVOID *)&spWeb);
  spWeb->put_AddressBar(VARIANT_TRUE);
  spWeb->put_MenuBar(VARIANT_TRUE);
  spWeb->put_ToolBar(VARIANT_TRUE);

Ideas on background problem welcome as well as the usage of the IOleCommandTarget