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)
LVL 1
rwood_ukAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rwood_ukAuthor Commented:
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.
0
SpideyModCommented:
PAQ'd and points refunded.

SpideyMod
Community Support Moderator @Experts Exchange
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.