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. External program execution

External program execution

Scheduled Pinned Locked Moved C / C++ / MFC
c++
6 Posts 5 Posters 27 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
    Mark
    wrote on last edited by
    #1

    I would like to know how I can execute another program from within my MFC apps.

    P L D L 4 Replies Last reply
    0
    • M Mark

      I would like to know how I can execute another program from within my MFC apps.

      P Offline
      P Offline
      Peter Zajac
      wrote on last edited by
      #2

      To execute another program from within your MFC/SDK application you can use 'ShellExecute'. ================== The original message was: I would like to know how I can execute another program
      from within my MFC apps.

      M 1 Reply Last reply
      0
      • M Mark

        I would like to know how I can execute another program from within my MFC apps.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        ================== The original message was: I would like to know how I can execute another program
        from within my MFC apps.

        1 Reply Last reply
        0
        • M Mark

          I would like to know how I can execute another program from within my MFC apps.

          D Offline
          D Offline
          David Leikis
          wrote on last edited by
          #4

          ================== The original message was: I would like to know how I can execute another program
          from within my MFC apps. I recommend using the _exec function or any of the variations of it. Look it up in C++ help since the command instructions are extensive. Best wishes for the holday!

          1 Reply Last reply
          0
          • P Peter Zajac

            To execute another program from within your MFC/SDK application you can use 'ShellExecute'. ================== The original message was: I would like to know how I can execute another program
            from within my MFC apps.

            M Offline
            M Offline
            Mark
            wrote on last edited by
            #5

            ================== The original message was: To execute another program from within your MFC/SDK application you can use 'ShellExecute'.

            ==================
            The original message was:

            I would like to know how I can execute another program
            from within my MFC apps. Thanks, This is what I needed

            1 Reply Last reply
            0
            • M Mark

              I would like to know how I can execute another program from within my MFC apps.

              L Offline
              L Offline
              Lanz Jean Claude
              wrote on last edited by
              #6

              STARTUPINFO si; PROCESS_INFORMATION pi; BOOL bResult; // Initialise the STARTUPINFO structure memset(&si, 0, sizeof(si)); si.cb = sizeof(si); si.dwFlags = STARTF_USESHOWWINDOW; si.wShowWindow = SW_SHOW; bResult = ::CreateProcess(NULL, // no executable module name (use command line) "WordPad.Exe", // command line, file name in same directory as the DLL NULL, // process handle not inheritable NULL, // thread handle not inheritable FALSE, // handle inheritance 0, // no creation flags NULL, // use parent's environnement block NULL, // use parent's starting directory &si, // pointer to STARTUPINFO structure &pi); // pointer to PROCESS_INFORMATION structure if (!bResult) { TRACE("Can't start WordPad.Exe\n"); } regards, Jean-Claude.

              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