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. Execute Program without waiting for termination

Execute Program without waiting for termination

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

    I need to execute 2 programs from within a program I am writing. I tried system() and winexec(). It would execute the first program and stop. It wouldn't execute the second program till I closed the first program.

    S R T 3 Replies Last reply
    0
    • B balaclavabob

      I need to execute 2 programs from within a program I am writing. I tried system() and winexec(). It would execute the first program and stop. It wouldn't execute the second program till I closed the first program.

      S Offline
      S Offline
      swaroopvtk
      wrote on last edited by
      #2

      i think u have to use threads.but i am not good at threads.sorry

      1 Reply Last reply
      0
      • B balaclavabob

        I need to execute 2 programs from within a program I am writing. I tried system() and winexec(). It would execute the first program and stop. It wouldn't execute the second program till I closed the first program.

        R Offline
        R Offline
        Ryan Binns
        wrote on last edited by
        #3

        Try CreateProcess()

        Ryan

        "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

        D 1 Reply Last reply
        0
        • R Ryan Binns

          Try CreateProcess()

          Ryan

          "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

          D Offline
          D Offline
          DasdaDAS
          wrote on last edited by
          #4

          yes, I'm sure CreateProcess() is the right solution. Zxczc

          1 Reply Last reply
          0
          • B balaclavabob

            I need to execute 2 programs from within a program I am writing. I tried system() and winexec(). It would execute the first program and stop. It wouldn't execute the second program till I closed the first program.

            T Offline
            T Offline
            Tareq Ahmed Siraj
            wrote on last edited by
            #5

            Why not simple ::SellExecute()? Try this...

            ::ShellExecute(NULL, _T("open"), _T("c:\\windows\\notepad.exe"), _T(""), _T(""), SW_SHOW);
            

            Hope this helps. - tareq

            B 1 Reply Last reply
            0
            • T Tareq Ahmed Siraj

              Why not simple ::SellExecute()? Try this...

              ::ShellExecute(NULL, _T("open"), _T("c:\\windows\\notepad.exe"), _T(""), _T(""), SW_SHOW);
              

              Hope this helps. - tareq

              B Offline
              B Offline
              balaclavabob
              wrote on last edited by
              #6

              Thanks tareq, worked perfectly.

              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