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. How do l execute a program from within the code?

How do l execute a program from within the code?

Scheduled Pinned Locked Moved C / C++ / MFC
adobequestion
4 Posts 4 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.
  • C Offline
    C Offline
    citress
    wrote on last edited by
    #1

    Hi everyone, l'm currently working on linking a program to its GUI application. And l was wondering if executing the program from within the GUI code is the correct way to approach it. lf it is, can someone give me some suggestions as to how l should go about it? l've tried calling the system command in my code (eg. system("program < inputDataFile") ), but doing so will result in a black window popping up. l do not want to see a black window flash for a couple of seconds everytime l run my program, so l hope there is another way to do this. Any comments will be appreciated, thanks!

    RaviBeeR G T 3 Replies Last reply
    0
    • C citress

      Hi everyone, l'm currently working on linking a program to its GUI application. And l was wondering if executing the program from within the GUI code is the correct way to approach it. lf it is, can someone give me some suggestions as to how l should go about it? l've tried calling the system command in my code (eg. system("program < inputDataFile") ), but doing so will result in a black window popping up. l do not want to see a black window flash for a couple of seconds everytime l run my program, so l hope there is another way to do this. Any comments will be appreciated, thanks!

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      See this article. /ravi Let's put "civil" back into "civilization" http://www.ravib.com ravib@ravib.com

      1 Reply Last reply
      0
      • C citress

        Hi everyone, l'm currently working on linking a program to its GUI application. And l was wondering if executing the program from within the GUI code is the correct way to approach it. lf it is, can someone give me some suggestions as to how l should go about it? l've tried calling the system command in my code (eg. system("program < inputDataFile") ), but doing so will result in a black window popping up. l do not want to see a black window flash for a couple of seconds everytime l run my program, so l hope there is another way to do this. Any comments will be appreciated, thanks!

        G Offline
        G Offline
        Georg Haan
        wrote on last edited by
        #3

        To keep the black window from popping up, try WinExec with the SW_HIDE flag. Even better would be to redirect output entirely, not to a file, but to a pipe. Nothing gets written to a drive this way... Microsoft has sample code for this, you'l find ithere. Georg Haan

        1 Reply Last reply
        0
        • C citress

          Hi everyone, l'm currently working on linking a program to its GUI application. And l was wondering if executing the program from within the GUI code is the correct way to approach it. lf it is, can someone give me some suggestions as to how l should go about it? l've tried calling the system command in my code (eg. system("program < inputDataFile") ), but doing so will result in a black window popping up. l do not want to see a black window flash for a couple of seconds everytime l run my program, so l hope there is another way to do this. Any comments will be appreciated, thanks!

          T Offline
          T Offline
          Todd Smith
          wrote on last edited by
          #4

          Try CreateProcess Todd Smith

          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