Restarting an application from within the same application
-
Hi I am working in VC++ with an SDI application. I have button on my UI, on click of the button, I should close the application and i.e the executable and restart it again. Can anyone please give me some inputs for doing this? Thanks Madhavi
-
Hi I am working in VC++ with an SDI application. I have button on my UI, on click of the button, I should close the application and i.e the executable and restart it again. Can anyone please give me some inputs for doing this? Thanks Madhavi
(make a smal prgrm(Restarter.exe) to ShellExecute ur main appln , which after executing the main program gets closed) in the main appln's close event, shellexecute(Restarter.exe)before CDialog::OnClose(); in the startup of the Restarter.exe, ShellExecute(mainappln.exe) and issue ::close(); to terminate itself. may be a bad idea..:( but it'll work..:) regards, Rookie
-
(make a smal prgrm(Restarter.exe) to ShellExecute ur main appln , which after executing the main program gets closed) in the main appln's close event, shellexecute(Restarter.exe)before CDialog::OnClose(); in the startup of the Restarter.exe, ShellExecute(mainappln.exe) and issue ::close(); to terminate itself. may be a bad idea..:( but it'll work..:) regards, Rookie
-
Hi, Thanks.. I am able to restart the application, but while closing it some threads are still running at the background. Can you pls help in shutting it down forcibily. Thanks Madhavi
See here for the proper way to shut down a thread.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown