CProgressCtrl problem in long function
-
My app (if you play Freelancer, you've probably used it) has a function that takes up to 60 seconds to complete, and updates the current status using a CProgressCtrl. The problem is, sometimes after a little while (usually around half way) the progress control stops updating (even though I'm calling ProgressCtrl.RedrawWindow() every time), thus making the user think my app has stopped responding. Is there any way to get around that problem, without having to go through all the work and trouble of making a separate worker thread?
-
My app (if you play Freelancer, you've probably used it) has a function that takes up to 60 seconds to complete, and updates the current status using a CProgressCtrl. The problem is, sometimes after a little while (usually around half way) the progress control stops updating (even though I'm calling ProgressCtrl.RedrawWindow() every time), thus making the user think my app has stopped responding. Is there any way to get around that problem, without having to go through all the work and trouble of making a separate worker thread?
Yes, don't send as many messages to the control. I once had an app that read in a big database (like 50K records) and sent a msg after every record. It did exactly what you describe. Once I changed it to send a message every few hundred records, it worked perfectly. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Actual sign at the laundromat I go to: "No tinting or dying."
-
Yes, don't send as many messages to the control. I once had an app that read in a big database (like 50K records) and sent a msg after every record. It did exactly what you describe. Once I changed it to send a message every few hundred records, it worked perfectly. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Actual sign at the laundromat I go to: "No tinting or dying."