8

我正在开发一个 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 或 IE7 上不是问题。关于出了什么问题的任何想法?我正在使用 AddInExpress 创建命令按钮。

干杯! 基督教

4

2 回答 2

5

ERROR_BUSY 通常发生在 IE 执行其他操作时,例如显示 window.alert 消息框。
尝试抑制脚本错误并实施 IDocHostShowUI 并返回 S_OK 而不会阻塞消息泵

于 2010-02-10T03:08:05.643 回答
1

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.

于 2011-02-10T06:18:26.130 回答