当前位置: 动力学知识库 > 问答 > 编程问答 >

Pass Control form one Executable to another C++

问题描述:

This question already has an answer here:

  • Differences between fork and exec

    7 answers

网友答案:

The exec family of functions replace one running program image with another. Open files and various other bits of state are preserved, which may or may not be what you want; write glue code as appropriate.

网友答案:

You have not specified OS, so here is a Windows specific answer...

Here are a few ways:

1) use a monitoring service application, that you write yourself to check status of PID/exenames. When the first app is no longer running, the service application can start the next app. In this way, you can daisy chain as many apps as you like together end to end, or simply bounce back and forth between app 1 & app 2. Service App

2) You can launch the second from a call in the first app just as it exits, and visa versa.

3) Use task scheduler.

There are many other ways, I personally recommend the first one as I have used it several times, and it works reliably.

分享给朋友:
您可能感兴趣的文章:
随机阅读: