Re: After Navigate() webbrowser properties are invalid

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 11/23/04


Date: Tue, 23 Nov 2004 11:45:27 -0500


"elisabete" <liscerq@gmx.ch> wrote in message
news:57ee422a.0411230705.4ea9bf84@posting.google.com
> Scenario 1:
> -----------
> I have a VC++ project that at some point must POST an HTTP request to
> a server (not using controls). I am using IWebBrowser Navigate()
> function to POST an HTTP request to a server.
>
> Problem 1:
> -----------
> The Navigate() function works fine, but afterwards, if I check the
> value of the webbrowser properties get_LocationURL() and
> get_LocationName() I get an empty string...

Do you check the URL immediately? You should wait at least until
NavigateComplete2 event fires. Also, does your application run a message
pump? WebBrowser performs navigations asynchronously and requires
message pump.

> Scenario 2:
> -----------
> I implemented sink class to handle events of DWebBrowserEvents2 (like
> BeforeNavigate, NavigateComplete2).
>
> Problem 2:
> ----------
> No events are fired...

Again - do you run a message pump? You cannot use WebBrowser with a
tight loop.

-- 
With best wishes,
    Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925 


Relevant Pages

  • Re: DHCP & DNS
    ... on a local server on our network. ... He would not be able to navigate to it because your machine ... I've modified my hosts file and put in the IP of my router and then ... But modifying one's host file can be convenient. ...
    (Fedora)
  • Exchange 2000 to Exchange 2003 swing migration - DCOM errors
    ... I have added an Exchange 2003 FE server which accepts POP and HTTP ... navigate to the following registry value ... Double-click Administrative Tools and then double-click Component Services. ... Config. ...
    (microsoft.public.exchange.setup)
  • Re: Ghosting Win 2003 -- Cant log-in
    ... Run regedit and open the server registry. ... If you already have a value DosDevices\C:, rename it to something else. ... Navigate to HKLM/Software/Microsoft/Windows NT/Current Version/ ...
    (microsoft.public.windows.server.general)
  • PageRequestManagerServerErrorException when using server.transfer
    ... 1- navigate to a page containing a UpdatePanel using SERVER.TRANSFER ... (Consequently a 404 server response is returned by the server. ... Partial Class restricted_beta2Test ... Protected Sub lnkBtnText_Click(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: The mystery of landscape printing
    ... > guessing most people expect that once a navigate request has been ... non-existent server whose name takes a long time to resolve. ... figure out the MIME type of the content. ... Internet operations are ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)