IWebBrowser2: Navigate2 ignored

From: Tim Bücker (timtos_NO-SPAm__at_web.de)
Date: 12/16/04


Date: Thu, 16 Dec 2004 05:41:31 +0100

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

Has someone an idea what I am doing wrong?
Here´s the code:

HRESULT hr;
IWebBrowser2* pWebBrowser = NULL;
HRESULT comInit = CoInitializeEx(NULL,COINIT_MULTITHREADED);
hr = CoCreateInstance (CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER,
IID_IWebBrowser2, (LPVOID*)&pWebBrowser);
if (SUCCEEDED (hr) && (pWebBrowser != NULL))
{
    m_pWebBrowser = pWebBrowser;
    m_pWebBrowser->put_RegisterAsBrowser(VARIANT_TRUE);
    m_pWebBrowser->put_AddressBar(VARIANT_FALSE);
    m_pWebBrowser->put_MenuBar(VARIANT_FALSE);
    m_pWebBrowser->put_StatusBar(VARIANT_FALSE);
    m_pWebBrowser->put_ToolBar(VARIANT_FALSE);
    m_pWebBrowser->put_Visible (VARIANT_TRUE);
    m_pWebBrowser->put_Offline(VARIANT_FALSE);
}
else
{
    if (pWebBrowser)
    pWebBrowser->Release ();
}
CComVariant *url = new CComVariant("http://localhost/");
// VARIANT* url = new "http://www.microsoft.com";
m_pWebBrowser->Navigate2(url, NULL, NULL, NULL, NULL);

Thanks a lot for any help!
Greetings,
Tim.



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; ...
    (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)
  • 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. ... RPC error because marshaller does not like these NULLs. ... CComVariant varEmpty; ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)