In a CPU-time consuming application I want to inform the user of the progress and give the possibility to stop the app and change the parameters. My problem is that the menu with the look for and stop items become visible after all the arithmetical work. How to arrange this better.
With regards,
Jan van der Graaf
With regards,
Jan van der Graaf
(I moved the thread to main since it isn't directly related with Iczelion's tutorials)
Just put the calculation stuff inside the thread, and every now and then use WaitForSingleObject in that thread to check if an event has been set. In the main program you can then set the event when you want the thread to do something (stop, pause, etc). From your code I see you are already using a thread but you should put the calculations in the thread and only the control (start, stop, pause) in the main program (not the other way around).
Thomas
P.S. Welkom op het forum :)
Just put the calculation stuff inside the thread, and every now and then use WaitForSingleObject in that thread to check if an event has been set. In the main program you can then set the event when you want the thread to do something (stop, pause, etc). From your code I see you are already using a thread but you should put the calculations in the thread and only the control (start, stop, pause) in the main program (not the other way around).
Thomas
P.S. Welkom op het forum :)
I think that Icz does pretty much what you want to do .. I haven't looked at your code though.
But check out Icz lesson16 http://spiff.tripnet.se/~iczelion/tut16.html
And yes .... welcome:cool:
But check out Icz lesson16 http://spiff.tripnet.se/~iczelion/tut16.html
And yes .... welcome:cool:
Thanks for both replies. Now the skeleton works fine. It?s time to fill it with real stuff. (Scheduling problem focused on schooltimetable).
Jan van der Graaf
Jan van der Graaf