Calling .exe withing project.
-
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?
-
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?
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.
-
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?
Use
CreateProcess()
orShellExecute()
.WinExec()
can be used for 16-bit systems, andsystem()
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