Link to home
Start Free TrialLog in
Avatar of rwood_uk
rwood_uk

asked on

Problem hosting WebBrowser control


I'm having a bit of trouble with the web browser control. I implement IDocHostUIHandler and IOleClientSite and set the an instance of the implementing object as the client site for the web browser.

Everything worked fine when the application was a single window containing a web browser, menus etc; however, once I put the web browser control into a tab pane it looses the ability to navigate after a point.

Just after creation of the browser control it is possible to navigate to a web site. If any other windows come up the result is a COMException with the "Requested resource is in use" message (stack trace below).

I had heard something about this kind of problem but hadn't seen a solution, and also heard that it was likely to be possible with version 1.1 of the framework. Having tried it with both the 1.0 and 1.1 frameworks, I was wondering if anyone had encountered and fixed similar problems.

Thanks in advance
Russ

Unhandled Exception: System.Runtime.InteropServices.COMException (0x800700AA): The requested resource is in use.
   at SHDocVw.IWebBrowser2.Navigate(String URL, Object& Flags, Object& TargetFrameName, Object& PostData, Object& Headers)
   at AxSHDocVw.AxWebBrowser.Navigate(String uRL, Object& flags, Object& targetFrameName, Object& postData, Object& headers)
Avatar of rwood_uk
rwood_uk

ASKER

Have discovered what the problem was, I was setting a parent component of the tab control containing the web browser to have Enabled = false whilst a dialog was active, then attempting to Navigate() before the Enabled flag had been set to true again. For some reason this doesn't work.
ASKER CERTIFIED SOLUTION
Avatar of SpideyMod
SpideyMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial