Re: How to navigate different URL's in the same browser

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



KeepFaith <vadnala@xxxxxxxxx> wrote:
I am trying to browse multiple URL's in the same browser calling
Navigate2 but it always opens it in a new window

// Navigate the URL
COleVariant vUrl(sUrl.GetString(), VT_BSTR);
COleVariant vFlags(long(navNoHistory), VT_I4);
COleVariant vNull(LPCTSTR(NULL), VT_BSTR);
COleSafeArray vPostData;
hRes = m_pWebBrowser->Navigate2(vUrl, &vFlags, &vNull, &vPostData,
&vNull);

Pass a variant of type VT_EMPTY as the third parameter, rather than an
empty string. Like this:

COleVariant vEmpty;

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

  • Navigate2() casts in MFC BHO
    ... To call Navigate2() casting to ... COleVariant objects sems to be necesssary. ... MFC apps must not #include. ... The question is either how to include afxdisp.h in an MFC dll or how to cast ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: How to navigate different URLs in the same browser
    ... Navigate2 but it always opens it in a new window ... COleVariant vFlags, VT_I4); ...     Igor Tandetnik ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)