5

Am working on VC++ application.

Figuring out how to restart my own application

Can somebody show some example

user1465461
  • 397
  • 2
  • 6
  • 17
  • 1
    Its QT: but may be you find helpful [how to restart my own qt application?](http://stackoverflow.com/questions/5129788/how-to-restart-my-own-qt-application) – Grijesh Chauhan Mar 04 '13 at 08:32
  • http://stackoverflow.com/questions/10101391/how-to-smooth-restart-a-c-program-without-shut-down-the-running-program – Grijesh Chauhan Mar 04 '13 at 08:34
  • If your target platform is windows. This may help to you. http://msdn.microsoft.com/en-us/library/aa373524%28VS.85%29.aspx – Nayana Adassuriya Mar 05 '13 at 03:40

1 Answers1

3

Write a program, which will:

  • Wait for your application to terminate
  • Run it again.

Call this program, then exit your application. This solution is quite widely used.


Another option:

Call your application with specific parameter (eg. /restarted). The new instance should wait for the old one to terminate before performing any tasks. Then shut down the old instance.

Spook
  • 25,318
  • 18
  • 90
  • 167
  • 2
    Why don't you search for this on the Internet? The C++ example doing exactly what you asked for is quite easy to find using Google. – Spook Mar 04 '13 at 09:42