Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » Problem breaking loop (with close button) in main thread
Re: Problem breaking loop (with close button) in main thread [message #59043 is a reply to message #59041] Wed, 19 October 2022 20:56 Go to previous messageGo to previous message
awksed is currently offline  awksed
Messages: 61
Registered: April 2012
Member
Hi Lance,

As I said in my original post

Quote:

Adding Ctrl::ProcessEvents() causes a "WM_PAINT invoked ... while in Paint routine" error.


Looking at ProcessEvents() (it calls Windows PeekMessage) I tried PeekMessage with PM_REMOVE and also PM_NOREMOVE. This make things much worse (totally hung the app). Used as per Microsoft example it works ok for the first loops and subsequently loops continuously.

I guess the problem is calling ProcessEvents/PeekMessage from within Paint.

As the app not responding for a minute (showing the wait cursor) if a mutex is never acquired (while allowing the window to be dragged using the title bar) and then telling the user to restart the app is not so bad. Especially only once every 5 years Very Happy .

So I shall give up and stop spinning my wheels on this one.

Thanks again for your efforts.

Cheers.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dealing with background tasks elegantly in a userinterface
Next Topic: error / memory leak in HttpServer example
Goto Forum:
  


Current Time: Tue Apr 30 04:05:22 CEST 2024

Total time taken to generate the page: 0.08040 seconds