My program is running on its own all day and night. I’d like to restart the computer sometime at night to clear up memory etc. I’ve noticed that trying to shutdown the pc, before exitting the OFW app, it hangs on trying to clear memory for something (possibly quicktime).
One idea might be to quit the software from within ofw at a set time, say 8pm. Then at 8.30 a windows scheduled tasks shuts down the pc.
Do you know any c++ lib that will let you restart/shutdown a pc so I can do it from within my code?
I have looked into this now. The problem with calling shutdown, is that the app crashes upon exit.
If from windows you call:
shutdown -r -t 00
It attempts to restart the computer. It closes the app window, then tries to close the console window, causing it to bring up the quicktime unloading error
then you could run a bat script - first, kill the app, sleep for a second then restart the computer.
we will look at the qt issue, but I think it related to us not getting the atExit call when the app is quit in a certain way - I’m not certain we will have a fix for it, but will definitely try.
yeah - I was thinking in bat file : force quit, take a breath (ie, pause) then call the restart. should be all you need to get the app down and computer restarted.
My app starts automatically when Windows starts. I also want the app to stop when the computer is shutting down after pressing the power button. The error dialog stopped the computer from shutting down.
I found a key in the Windows registry to force a shutdown and not wait for the error message to be clicked away.