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. CreateProcess ???

CreateProcess ???

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
6 Posts 3 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.
  • W Offline
    W Offline
    will1383
    wrote on last edited by
    #1

    I'm using the CreateProcess to run an application. Here's how I am calling it: if (CreateProcess(cmd, cmdline, NULL, NULL, TRUE, 0 /*CREATE_NEW_CONSOLE */, NULL, NULL, &si, &pi) != 0){ My problem is I'm passing in a command line option, but the option is NOT being sent to the application being run. The app runs and Create Process returns correctly, but the app I'm running just doesn't do what I want it to. I've looked through the MSDN definition, but I haven't found a solution. I've tried everything it suggests, but it still doesn't work, not matter what command line option I put in there. None of them get passed in. Anyone have any ideas or suggestions? Thanks!

    R V 2 Replies Last reply
    0
    • W will1383

      I'm using the CreateProcess to run an application. Here's how I am calling it: if (CreateProcess(cmd, cmdline, NULL, NULL, TRUE, 0 /*CREATE_NEW_CONSOLE */, NULL, NULL, &si, &pi) != 0){ My problem is I'm passing in a command line option, but the option is NOT being sent to the application being run. The app runs and Create Process returns correctly, but the app I'm running just doesn't do what I want it to. I've looked through the MSDN definition, but I haven't found a solution. I've tried everything it suggests, but it still doesn't work, not matter what command line option I put in there. None of them get passed in. Anyone have any ideas or suggestions? Thanks!

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      merge the app string and the commandline string into one, put it instead of your command, set the commandline to NULL. ~RaGE();

      W 1 Reply Last reply
      0
      • R Rage

        merge the app string and the commandline string into one, put it instead of your command, set the commandline to NULL. ~RaGE();

        W Offline
        W Offline
        will1383
        wrote on last edited by
        #3

        I've already tried that as well. I've tried all the ways that MSDN suggest. When I use that method, I get an error 2, which means "The system cannot find the file specified." or ERROR_FILE_NOT_FOUND. But the file is there, and the path is correct. I also tried adding the app name to the commandline string and setting the command to NULL, as well as having the command in there as well. Any other ideas or suggestions?

        R 2 Replies Last reply
        0
        • W will1383

          I've already tried that as well. I've tried all the ways that MSDN suggest. When I use that method, I get an error 2, which means "The system cannot find the file specified." or ERROR_FILE_NOT_FOUND. But the file is there, and the path is correct. I also tried adding the app name to the commandline string and setting the command to NULL, as well as having the command in there as well. Any other ideas or suggestions?

          R Offline
          R Offline
          Rage
          wrote on last edited by
          #4

          Are you _really_ sure no command line is passed ? Already tried to start some dummy batch file with a echo %1 or something like that, that would display the command line ? ~RaGE();

          1 Reply Last reply
          0
          • W will1383

            I've already tried that as well. I've tried all the ways that MSDN suggest. When I use that method, I get an error 2, which means "The system cannot find the file specified." or ERROR_FILE_NOT_FOUND. But the file is there, and the path is correct. I also tried adding the app name to the commandline string and setting the command to NULL, as well as having the command in there as well. Any other ideas or suggestions?

            R Offline
            R Offline
            Rage
            wrote on last edited by
            #5

            If you really don't get it to work, but need it to continue coding, use a ShellExecute or WinExec until you have figured it out. :rolleyes: ~RaGE();

            1 Reply Last reply
            0
            • W will1383

              I'm using the CreateProcess to run an application. Here's how I am calling it: if (CreateProcess(cmd, cmdline, NULL, NULL, TRUE, 0 /*CREATE_NEW_CONSOLE */, NULL, NULL, &si, &pi) != 0){ My problem is I'm passing in a command line option, but the option is NOT being sent to the application being run. The app runs and Create Process returns correctly, but the app I'm running just doesn't do what I want it to. I've looked through the MSDN definition, but I haven't found a solution. I've tried everything it suggests, but it still doesn't work, not matter what command line option I put in there. None of them get passed in. Anyone have any ideas or suggestions? Thanks!

              V Offline
              V Offline
              valikac
              wrote on last edited by
              #6

              Pass NULL for the first parameter inplace of "cmd." Post an example of the command line you pass in as the second parameter "cmdline." Kuphryn

              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