How can I know when the URL I specified to Navigate method get loaded?



Hi, everyone.

I don't know whether this is a stupid question, but I really hope that
you can help me out of it:

I ask the control to navigate with a url "http://foo.bar";, then I want
to get the notification when it gets loaded (say, in
NavigateComplete2()). I think up several possible approaches, but I
think they may be all problematic:

Approach (1) Since the input URL of NavigateComplete2 may have been
modified (by server side redirection, etc.), I cannot test whether
this URL equals to "http://foo.bar";.

Approach (2) After I invoke Navigate(), I just treat the NEXT
NavigationComplete2 on the top-level frame to be the "http://foo.bar";.
However, I think this may be wrong in some rare too, here is an
example:

Invoke Navigate() with "http://not.foo.bar"; --> Invoke Navigate() with
"http://foo.bar"; --> OnNavigateComplete2( "http://not.foo.bar"; ) -->
OnNavigateComplete2( "http://foo.bar"; )

Approach (3) Instead of invoking Navigate() to navigate, I think maybe
I can use ITravelLogStg::CreateEntry() with "http://foo.bar";, and get
a travel entry FooBarEntry, and then use
ITravelLogStg::TravelTo(FooBarEntry). In OnNavigateComplete2(), I
simply test whehter the current entry is FooBarEntry to know whether
the url has been loaded.

However, when the control just starts up and has no travel entry at
all, invoking ITravelLogStg::CreateEntry() will get an exception in
ieframe.dll !! As a result, before the first travel entry is set up (I
believe it is set up just before the NavigateComplete2 event), I
cannot use this approach.

So, I still cannot conquar the example I mentioned in Approach 2....


Anyone can help me out of this? Thanks very much in advance! My boss
is pushing me....
.



Relevant Pages

  • Re: UCOMIStream, MSHTML and WebBrowser control Persistence Problem
    ... If I navigate to a file ... > the same html I cannot call into the same dhtml script function. ... It is best to retrieve it from the control each time ...
    (microsoft.public.dotnet.languages.vb)
  • Re: UCOMIStream, MSHTML and WebBrowser control Persistence Problem
    ... If I navigate to a file ... > the same html I cannot call into the same dhtml script function. ... It is best to retrieve it from the control each time ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: UCOMIStream, MSHTML and WebBrowser control Persistence Problem
    ... If I navigate to a file ... > the same html I cannot call into the same dhtml script function. ... It is best to retrieve it from the control each time ...
    (microsoft.public.dotnet.general)
  • Re: AxSHDocVw.AxWebBrowser Error (on VB.NET 1.1 Winform)
    ... property, Refresh, and the Stop method, with no luck so far. ... trying to create the browser control programmatically at Run-time and destroy ... > property value in your axWebBroswer control and refuse to navigate if it is ...
    (microsoft.public.dotnet.framework.interop)
  • problems with WebBrowwser.Navigate
    ... We're running a WebBrowser object (through an AxWebBrowser activex control), ... "In Internet Explorer 6 or later, you can navigate through code only within ... Best guess is that this is thowing the error page, and that with no network ... the underlying object is unable to establish that the calling code and the ...
    (microsoft.public.dotnet.general)