8

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

Courtney Christensen
  • 9,165
  • 5
  • 47
  • 56
kh34
  • 181
  • 1
  • 3
  • 11
  • Can you run your app with Fiddler? This thread (http://forums.iis.net/t/1146952.aspx) suggests that the problem might not be on the client side and you might be getting an HTTP 500 back from the server. – Franci Penov Feb 09 '10 at 17:19
  • Unfortunately, there's no activity to be seen in Fiddler. But the error message is almost instant. Also, I'm curious as to what "The requested resource is in use" implies. I can see that the busy-property if true, but the browser is really doing nothing. – kh34 Feb 10 '10 at 01:17
  • 1
    It could be the issue mentioned [here](http://stackoverflow.com/a/20612526/238419) – BlueRaja - Danny Pflughoeft Dec 16 '13 at 13:53

2 Answers2

5

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

Sheng Jiang 蒋晟
  • 15,125
  • 2
  • 28
  • 46
  • 1
    The current URL is about:blank, also when checking the property on the IE.WebBrowser so I don't think it's actually doing anything. – kh34 Feb 10 '10 at 08:50
  • what is the return value of IWebBrowser2::get_ReadyState – Sheng Jiang 蒋晟 Feb 10 '10 at 12:19
  • 1
    try stop the current navigation (if you indeed want to stop when the page is not completed loaded) or add the navigation to a request queue and use a timer to wait IWebBrowser2::get_Busy returns false. – Sheng Jiang 蒋晟 Feb 10 '10 at 15:41
  • Adding an IEApp.Stop(); before the Nagivate, doesn't change the outcome, I'm afraid. – kh34 Feb 10 '10 at 22:45
  • 1
    what is the value of IWebBrowser2::get_Busy? – Sheng Jiang 蒋晟 Feb 10 '10 at 23:47
  • It says 'true', even right after I do a .Stop(); This is the code: string sURL; System.Object one = null; System.Object two = null; System.Object three = null; System.Object four = null; sURL = "http://www.google.dk"; IEApp.Stop(); MessageBox.Show(IEApp.Busy.ToString()); IEApp.Navigate(sURL, ref one, ref two, ref three, ref four); – kh34 Feb 11 '10 at 11:40
  • where is this code in? if it is button click then disable the button when the busy property is true. – Sheng Jiang 蒋晟 Feb 11 '10 at 21:59
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.

VinceMD
  • 111
  • 1
  • 7