AxWebBrowser and an E_FAIL! ... oh why did I become a programmer?

G

Guest

Oh--- I have about ripped all my hair out of my head on this one. I have
spent many sleepless nights pondering, tweaking, and cursing this error.
Please, please. Please I hope someone can help.

I have a program with 2 web browsers (of type AxSHDocVw.AxWebBrowser).
Whenever I click my simulated back button, my event listener fires and
executes this command:

myWebBrowser1.GoBack(); // simple, right? WRONG! Crashes here.

Immediately it throws this error:
HRESULT E_FAIL has been returned from a call to a COM component.
ErrorCode: -2147467259
Source: "Interop.SHDocVw"
InnerException: null

Why is this? I didn't change any code on this web browser object and it
was working fine. On my second web browser, I have the exact same handling
and setup (as far as I can tell). It (the second one) was the one last week
that was acting up like this one saying that the resource was in use (somehow
it looks like it resolved itself).

When I did searches on this, people say this error usually cannot be found
by the application, BUT in my code, I can still talk to the control with
different commands.

I have built a small scale program that has 2 web browsers and simulate the
actions, but cannot reproduce this problem with it.

I hope someone can fill us in here at my work. We are lost and have
depression setting in.

Thanks in advance for reading this.

Rob K
 
G

Guest

Hi! I had a similar problem long time ago. It turned out that my firewall
decided to block one application while allowing another one through. Check if
disabling your firewall/antivirus/antispyware solutions eliminates the
problem.

.... just a thought....
 
V

Vijay

Rob, I am not sure if you had thought about this... but just a idea..
GoBack(), I assume is accessing something in the history, that is not found
and is returning null...or probably the object is trying to access some file
or resource in the history for IE that is locked up...

What you could try is ...

Load the same page in Browser control 2 and try the GoBack()...

Try it on a different machine?

Clean the history for IE and try it..

HTH
VJ
 
G

Guest

Hello Mike. Thank you very much for responding. I tried your suggestions,
but no luck. My program still refuses to cooperate. I will keep trying
though....

Thanks,

Rob K
 
G

Guest

Hello Vijay and thank you for responding. I tried your suggestions but
haven't had any luck yet. However, I am curious about what you were saying
that the history item we are trying to access may be locked or somehow not
available.

I am unsure how to fix the problem, but I am still researching it every once
in a while when time permits I work on this project.

Thanks again for your help.

Rob K
 
G

Guest

Problem solved. I had a command like this in my code:

TestBrowser.Navigate("about:Blank");

If you try to use the GoBack after this, the object totaly craps out and
doesn't tell you why ( that I could see or understand anyways).

So I just trashed this line, and everything worked great!

Rob K
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top