Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Need help with NewWindow3 and IWebBrowse2

Need help with NewWindow3 and IWebBrowse2

Scheduled Pinned Locked Moved C / C++ / MFC
questioncomhelptutorial
21 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Paul Groetzner

    Would you believe I *FINALLY* got it working? Here's the code to make it work.... ON_EVENT(CLoadWebSite, IDC_EXPLORER, 273 /* NewWindow3 */, OnNewWindow3Explorer1, VTS_DISPATCH VTS_PBOOL VTS_BSTR VTS_BSTR VTS_BSTR) void CLoadWebSite::OnNewWindow3Explorer1(LPDISPATCH FAR* ppDisp, BOOL FAR* Cancel, BSTR Flags, BSTR URLContext, BSTR URL) { CString strURL; // capture URL of any link clicked that would attempt to open in a new window if (URL != NULL) strURL = (LPCTSTR)URL; *Cancel = TRUE; // prevent IE from spawning Browser.Navigate(strURL,NULL,NULL,NULL,NULL); // loads resulting URL into the web browser control instead of a spawned IE window }

    D Offline
    D Offline
    David Crow
    wrote on last edited by
    #21

    univega_r304 wrote:

    strURL = (LPCTSTR)URL;

    This makes sense since a BSTR is really a type of char*. Could you have also done:

    strURL = URL;

    as the assignment operator should handle the typecast automatically? If not, oh well.


    "Money talks. When my money starts to talk, I get a bill to shut it up." - Frank

    "Judge not by the eye but by the heart." - Native American Proverb

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups