0

I'm using WatiN to attach to a WebBrowser control. The following code throws "HRESULT E_FAIL has been returned from a call to a COM component." in the IE constructor.

using (IE ie = new IE(browser.ActiveXInstance))
{
    ie.GoTo(uri);
}

Solution!

Settings.AutoStartDialogWatcher = false;
using (IE ie = new IE(browser.ActiveXInstance))
{
    ie.GoTo(uri);
}

See How to use watin with WebBrowser control? for further information about a replacement dialog watcher.

Community
  • 1
  • 1
stevieg
  • 652
  • 4
  • 14

1 Answers1

0

I'm not very good at this Stack Overflow thing. I saw the "[x] answer your own question" just after I pressed submit. Sorry.

Settings.AutoStartDialogWatcher = false;
using (IE ie = new IE(browser.ActiveXInstance))
{
    ie.GoTo(uri);
}
stevieg
  • 652
  • 4
  • 14
  • 1
    It's OK to answer your own question, but you may want to edit your question so it looks as a *question*, i.e., remove the answer from there and keep it here. – noseratio Feb 13 '14 at 03:43