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.