Re: IWebBrowser2: Navigate2 ignored

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 12/16/04


Date: Thu, 16 Dec 2004 09:42:36 -0500


"Tim Bücker" <timtos_NO-SPAm_@web.de> wrote in message
news:cpr5d3$tpj$1@news.uni-koblenz.de
> Hello.
>
> I am trying to launch the internet explorer from my program using the
> code seen below but unfortunately the Navigate2 command is ignored.
> So Navigate2 is not working but calling GoHome() the start page is
> being displayed...???
>
> m_pWebBrowser->Navigate2(url, NULL, NULL, NULL, NULL);

You can't pass NULLs, you need to pass a valid pointer to an empty
variant. If you check the HRESULT returned by this call, you'll see an
RPC error because marshaller does not like these NULLs. Do it this way:

CComVariant url(OLESTR("http://localhost/"));
CComVariant varEmpty;
m_pWebBrowser->Navigate2(&url,
    &varEmpty, &varEmpty, &varEmpty, &varEmpty);

-- 
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

  • IWebBrowser2: Navigate2 ignored
    ... I am trying to launch the internet explorer from my program using the code ... seen below but unfortunately the Navigate2 command is ignored. ... HRESULT comInit = CoInitializeEx; ...
    (comp.lang.cpp)
  • IWebBrowser2: Navigate2 ignored
    ... I am trying to launch the internet explorer from my program using the code ... seen below but unfortunately the Navigate2 command is ignored. ... HRESULT comInit = CoInitializeEx; ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: IWebBrowser2: Navigate2 ignored
    ... > I am trying to launch the internet explorer from my program using the code ... > seen below but unfortunately the Navigate2 command is ignored. ...
    (comp.lang.cpp)