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. What to do when ShellExecute fails?

What to do when ShellExecute fails?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpwindows-adminquestion
7 Posts 4 Posters 1 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.
  • M Offline
    M Offline
    Miroslav Rajcic
    wrote on last edited by
    #1

    I am trying to execute soem arbitrary file using code below. SHELLEXECUTEINFO si; ZeroMemory(&si,sizeof(si)); si.cbSize = sizeof(si); si.hwnd = NULL; si.lpVerb = "Open"; si.nShow = SW_SHOW; si.lpFile = szFileName; si.lpParameters = NULL; si.lpDirectory = m_strCurDir; si.fMask = SEE_MASK_FLAG_NO_UI; ShellExecuteEx(&si); My problem is that for ".dsw" files (Visual C++ project files) this function fails (with "no association" error). What can I do to successfully execute even this kind of files? Does anyone has a code for that (registry digging?) ? Thanks in advance. Miroslav Rajcic

    N J 2 Replies Last reply
    0
    • M Miroslav Rajcic

      I am trying to execute soem arbitrary file using code below. SHELLEXECUTEINFO si; ZeroMemory(&si,sizeof(si)); si.cbSize = sizeof(si); si.hwnd = NULL; si.lpVerb = "Open"; si.nShow = SW_SHOW; si.lpFile = szFileName; si.lpParameters = NULL; si.lpDirectory = m_strCurDir; si.fMask = SEE_MASK_FLAG_NO_UI; ShellExecuteEx(&si); My problem is that for ".dsw" files (Visual C++ project files) this function fails (with "no association" error). What can I do to successfully execute even this kind of files? Does anyone has a code for that (registry digging?) ? Thanks in advance. Miroslav Rajcic

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      What happens when you manually double click on a dsw file? Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

      M J 2 Replies Last reply
      0
      • N Nish Nishant

        What happens when you manually double click on a dsw file? Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

        M Offline
        M Offline
        Miroslav Rajcic
        wrote on last edited by
        #3

        Nothing, I just get error code "no association" from API Miroslav Rajcic

        N 1 Reply Last reply
        0
        • N Nish Nishant

          What happens when you manually double click on a dsw file? Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

          J Offline
          J Offline
          Jon Hulatt
          wrote on last edited by
          #4

          look at the console commands assoc and ftype . Your shell associations for .dsw are screwed. Sorry to dissapoint you all with my lack of a witty or poignant signature.

          M 1 Reply Last reply
          0
          • M Miroslav Rajcic

            Nothing, I just get error code "no association" from API Miroslav Rajcic

            N Offline
            N Offline
            Nish Nishant
            wrote on last edited by
            #5

            I think somehow your dsw association got removed. You'll need to re-associate it to Visual Studio [msdev]. Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

            1 Reply Last reply
            0
            • J Jon Hulatt

              look at the console commands assoc and ftype . Your shell associations for .dsw are screwed. Sorry to dissapoint you all with my lack of a witty or poignant signature.

              M Offline
              M Offline
              Miroslav Rajcic
              wrote on last edited by
              #6

              Thanks. I'll look into that. Miroslav Rajcic

              1 Reply Last reply
              0
              • M Miroslav Rajcic

                I am trying to execute soem arbitrary file using code below. SHELLEXECUTEINFO si; ZeroMemory(&si,sizeof(si)); si.cbSize = sizeof(si); si.hwnd = NULL; si.lpVerb = "Open"; si.nShow = SW_SHOW; si.lpFile = szFileName; si.lpParameters = NULL; si.lpDirectory = m_strCurDir; si.fMask = SEE_MASK_FLAG_NO_UI; ShellExecuteEx(&si); My problem is that for ".dsw" files (Visual C++ project files) this function fails (with "no association" error). What can I do to successfully execute even this kind of files? Does anyone has a code for that (registry digging?) ? Thanks in advance. Miroslav Rajcic

                J Offline
                J Offline
                James R Twine
                wrote on last edited by
                #7

                > My problem is that for ".dsw" files (Visual C++ project files) > this function fails (with "no association" error).    This is a shot in the dark, but do you get the same results when you use ShellExecute(...) instead?  I have noticed differences in the behavior of these functions for certain operations.    Peace! -=- James.

                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