0

The official documentation stated that the IWebBrowser2::Stop method "Cancels a pending navigation or download, and stops dynamic page elements, such as background sounds and animations".

I use a webbrowser control to show some local stuff (files) an remote content (URLs) by means of IWebbrowser2::Navigate2(). In some circumstances, I need to change the content before the load has finished.

The Stop() method seem be Ok for that task and indeed stop the load. But after that, the navigation engine seem frozen and unable to respond to new Navigate2() calls.

The question is: do is there some trickery to restart the control without create a new one?

Old newbie
  • 811
  • 2
  • 11
  • 21
  • 1
    Crystal ball says that you are deadlocking because you blocked the STA thread that owns the browser object. So the browser cannot fire DocumentComplete and transition state. If you want to navigate elsewhere then just don't call Stop() at all, Navigate2() already cancels the previous one. And never block an STA thread. – Hans Passant Jan 27 '16 at 11:09
  • So, the answer is there are not solution. It is a pity, because the long history is that I come fleeing of a exception in mshtml.dll, that I suspect comes from: a: calling Navigate2 method from two threads (using two different browser objects in the same application) b: calling very quickly the Navigate2 method with different URLs in the same thread. I'm desperate because after a lot of readings, it seems that: a: the mshtml.dll does not work properly with different threads. b: there is no way to catch the exception. c: there a not a safe and clean method to see if the browser has terminated – Old newbie Jan 27 '16 at 11:46
  • 1
    http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem – Hans Passant Jan 27 '16 at 11:53
  • Thank you for your comments and your reference to Meta Stack Exchange, a site that did not know. But I still have to digest if you are subtly saying me silly for not knowing ask the right question. Thank you anyway. – Old newbie Jan 27 '16 at 12:12

0 Answers0