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. Calling .exe withing project.

Calling .exe withing project.

Scheduled Pinned Locked Moved C / C++ / MFC
questiondiscussion
3 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.
  • C Offline
    C Offline
    CodeGoose
    wrote on last edited by
    #1

    Hello. I'm curious how you call an executable from within a VC project? So I have a .exe that i want to call to generate some files from within my program. Would like to be able to do something like this: void Do () { Call ("foo.exe", "command line args") ; } How do I do this? Is there a windows equivalent or similar? I need to pass it command line arguments. Thoughts?

    B D 2 Replies Last reply
    0
    • C CodeGoose

      Hello. I'm curious how you call an executable from within a VC project? So I have a .exe that i want to call to generate some files from within my program. Would like to be able to do something like this: void Do () { Call ("foo.exe", "command line args") ; } How do I do this? Is there a windows equivalent or similar? I need to pass it command line arguments. Thoughts?

      B Offline
      B Offline
      Brett Peirce
      wrote on last edited by
      #2

      ANSI standard c++ for console programs would be system("foo.exe command line args");. I would assume that it would be valid for use in VC++.


      sincerely, Brett Peirce - PolerBear To err is human; To forgive: divine.

      1 Reply Last reply
      0
      • C CodeGoose

        Hello. I'm curious how you call an executable from within a VC project? So I have a .exe that i want to call to generate some files from within my program. Would like to be able to do something like this: void Do () { Call ("foo.exe", "command line args") ; } How do I do this? Is there a windows equivalent or similar? I need to pass it command line arguments. Thoughts?

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Use CreateProcess() or ShellExecute(). WinExec() can be used for 16-bit systems, and system() is an antiquated function brought over from Unix.


        "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

        "There is no death, only a change of worlds." - Native American Proverb

        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