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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ShellExexute to open the default browswer

ShellExexute to open the default browswer

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studiocomhelpquestion
1 Posts 1 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.
  • S Offline
    S Offline
    sdancer75
    wrote on last edited by
    #1

    According to this microsoft's article [^], if I wanted to use ShellExecute to open the default browser instead of the Internet Explorer, I had to use

    LONG r = ShellExecute(NULL, "open", "http://www.microsoft.com", NULL, NULL, SW_SHOWNORMAL);

    Ok. In my case I want to open this url http://www.mywebsite.com/article/month/section. I am doing this :

    AfxParseURL((LPCTSTR)m_strWebURL, dwServiceType, strServerName, strObject,nPort);
    strServerName = _T("http://") + strServerName;
    ::ShellExecute(NULL,_T("open"),strServerName,strObject ,NULL,SW_SHOWMAXIMIZED);

    This piece of code crashes the Visual Studio 2008. The original code i used below is worked just fine but it uses Internet Explorer instead of the default browser.

    ::ShellExecute(NULL,_T("open"),_T("explorer"),m_strWebURL ,NULL,SW_SHOWMAXIMIZED);

    What seems to be the problem in microsoft's code ? Regards,

    sdancer75

    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