-
March 12th, 2008, 06:30 PM
#1
How to call another program?
Hi, I'm working on a program that can execute another program. I'm doing so because I need to run 2 different loops at once, and I don't know how to do that in one program. So my question is, how do I call to another program within my original program?
I'm aware of the std:system("filename") function. But when I call this function, the original program pauses and wait until the called program terminates. I need a function that can execute another program while the original still runs.
Thanks!
-
March 13th, 2008, 05:05 PM
#2
Re: How to call another program?
Look at this FAQ : How can I start a process?
Cheers
-
March 14th, 2008, 05:11 AM
#3
Re: How to call another program?
For the described problem
Threads
seem more appropriate.
Last edited by Boris K K; March 14th, 2008 at 05:14 AM.
Boris Karadjov
Brainbench MVP for Visual C++
http://www.brainbench.com/
-
March 14th, 2008, 04:31 PM
#4
Re: How to call another program?
Originally Posted by Boris K K
For the described problem
Threads
seem more appropriate.
Why using threads? if he will use ::CreateProcess() his original program will continue to run after the call to ::CreateProcess() without waiting for the external program to finish.....
Or maybe I misunderstood the question..
Cheers
-
March 17th, 2008, 04:32 AM
#5
Re: How to call another program?
I believe this is the true problem that needs solving:
Originally Posted by C++N00bie
I'm doing so because I need to run 2 different loops at once, and I don't know how to do that in one program.
and in Windows environment threads are better solution to it than processes. *NIX is another matter...
Last edited by Boris K K; March 17th, 2008 at 04:36 AM.
Boris Karadjov
Brainbench MVP for Visual C++
http://www.brainbench.com/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|