Rav Posted May 16, 2016 Posted May 16, 2016 Hello,I have a windowless application with integrated UniGui and I need it to close from one of its threads.Without UniGUI I didn't use Application.run, didn't handle messages and instead of it I used a special thread which checked globally defined variable ApplicationTerminated that could be set out of everywhere. Now with UniGUI I need to stop Application.run from another thread. All the ways mentioned from this topic are not working: Application.Terminate (no result);UniApplication.Terminate (access violation);MainModule.UniMainModule.Terminate (access violation) Is there another way of proper closing the application? Quote
bugra Posted May 16, 2016 Posted May 16, 2016 Hi; An UniGUI application can be closed from only its events like onclick, not other threads events. That's the reason why you are getting access violation error. Quote
Rav Posted May 16, 2016 Author Posted May 16, 2016 Thanks! Is there a workaround? UniThreadTimer? Server Module thread? Quote
Daryl McMurray Posted February 13, 2018 Posted February 13, 2018 try this UniApplication.Terminate('GoodBye'); // to put the app in a closed state in the browser PostThreadMessage(MainThreadID,wm_quit,0,0); // will tell the main application to terminate Use only for testing though... or users will be able to terminate the server.exe Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.