WebBrowser.Navigate(...) 抛出 COMException
我正在开发一个 Internet Explorer 命令按钮,单击后将打开特定的网页。下面是一段代码(IEApp
是对 IE.WebBrowser
实例的引用):
IEApp.Navigate(sURL, ref one, ref two, ref three, ref four);
上面的行抛出以下 COMException:
Exception Source: Interop.SHDocVw
Exception Type: System.Runtime.InteropServices.COMException
Exception Message: The requested resource is in use. (Exception from HRESULT: 0x800700AA)
Exception Target Site: Navigate
这在 IE6 或 IE6 上不是问题IE7。关于出了什么问题有什么想法吗?我正在使用 AddInExpress 创建命令按钮。
干杯! 基督教
I'm developing an Internet Explorer command button that will open a specific web page once clicked. Here's a snippet of code (IEApp
is a reference to an instance of IE.WebBrowser
):
IEApp.Navigate(sURL, ref one, ref two, ref three, ref four);
The above line throws the following COMException:
Exception Source: Interop.SHDocVw
Exception Type: System.Runtime.InteropServices.COMException
Exception Message: The requested resource is in use. (Exception from HRESULT: 0x800700AA)
Exception Target Site: Navigate
This wasn't a problem on IE6 or IE7. Any ideas on what's going wrong? I'm using AddInExpress for creating the command button.
Cheers!
Christian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这就是 ERROR_BUSY 通常在 IE 执行其他操作时发生,例如显示 window.alert 消息框。
尝试抑制脚本错误并实现 IDocHostShowUI 并返回 S_OK,而不阻塞消息泵
That's ERROR_BUSY usually happens when IE is doing something else, e.g. displaying a window.alert message box.
Try suppress script errors and Implement IDocHostShowUI and return S_OK without blocking the message pump
这可以帮助:如果您使用的是服务器类型版本,请在 Windows 中关闭 UAC:
此处的屏幕截图:http://blog.vincentbrouillet.com/post/2011/02/10/watin%3A-The-requested-resource-is-in -use
我遇到了这个错误,而且它是相当随机的。我尝试在运行测试之前杀死 IE。这确实有用,但并非总是如此。
could this help: turning off UAC in Windows, if you are using a server kind version:
screen-shoots here: http://blog.vincentbrouillet.com/post/2011/02/10/watin%3A-The-requested-resource-is-in-use
I had this error, and it was quite random. I tried killing IE before running the tests. It kind of work, but not all the time.