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. Database & SysAdmin
  3. System Admin
  4. WinExec(...)??

WinExec(...)??

Scheduled Pinned Locked Moved System Admin
helpquestion
7 Posts 3 Posters 8 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.
  • R Offline
    R Offline
    Rickard Andersson20
    wrote on last edited by
    #1

    When I try to run an application with WinExec it will not do what I want it to do!! :( WinExec(m_Path,SW_SHOW); m_Path is a varible of CString and contains the return value from FileDLg.GetPathName() (FileDialog is a CFileDialog). Isn't this the right way? The app does not run... HELP! SHOW ME HOW!? ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------

    R M 2 Replies Last reply
    0
    • R Rickard Andersson20

      When I try to run an application with WinExec it will not do what I want it to do!! :( WinExec(m_Path,SW_SHOW); m_Path is a varible of CString and contains the return value from FileDLg.GetPathName() (FileDialog is a CFileDialog). Isn't this the right way? The app does not run... HELP! SHOW ME HOW!? ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      Try using CreateProcess() instead. Perhaps the file name has embedded blanks which are causing problems? It's hard to offer help without specific information. I'm not sure what you mean by "it will not do what I want it to do!!". /ravi "There is always one more bug..." ravib@ravib.com http://www.ravib.com

      R 1 Reply Last reply
      0
      • R Ravi Bhavnani

        Try using CreateProcess() instead. Perhaps the file name has embedded blanks which are causing problems? It's hard to offer help without specific information. I'm not sure what you mean by "it will not do what I want it to do!!". /ravi "There is always one more bug..." ravib@ravib.com http://www.ravib.com

        R Offline
        R Offline
        Rickard Andersson20
        wrote on last edited by
        #3

        Stupid me! This is what I want it to do: Run that application that 'm_Path' contains (full path to it) ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------

        R 1 Reply Last reply
        0
        • R Rickard Andersson20

          When I try to run an application with WinExec it will not do what I want it to do!! :( WinExec(m_Path,SW_SHOW); m_Path is a varible of CString and contains the return value from FileDLg.GetPathName() (FileDialog is a CFileDialog). Isn't this the right way? The app does not run... HELP! SHOW ME HOW!? ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------

          M Offline
          M Offline
          Michael P Butler
          wrote on last edited by
          #4

          Well WinExec is a superceded function but I've not had any issues with it. What is the return value from the function. This should give you a clue to why it is failing. Michael :-)

          1 Reply Last reply
          0
          • R Rickard Andersson20

            Stupid me! This is what I want it to do: Run that application that 'm_Path' contains (full path to it) ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------

            R Offline
            R Offline
            Ravi Bhavnani
            wrote on last edited by
            #5

            Yes, I assumed that. But what status does the function return? /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

            R 2 Replies Last reply
            0
            • R Ravi Bhavnani

              Yes, I assumed that. But what status does the function return? /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

              R Offline
              R Offline
              Rickard Andersson20
              wrote on last edited by
              #6

              Ok, now I get o as return value. But when I test the string that I get from the registry it does not contain any characters! :/ If I open the registry editor I can see the string with path but when I try to ge it it obviously wont return right value... hm... ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------

              1 Reply Last reply
              0
              • R Ravi Bhavnani

                Yes, I assumed that. But what status does the function return? /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

                R Offline
                R Offline
                Rickard Andersson20
                wrote on last edited by
                #7

                Oh man! I feel so painful!! The error was that when I read from the registry. I read wrong folder! :mad: DAMN ME! ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------

                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