Reputation:
I want to send a message to the UI thread using PostMessage()
, and I need to guarantee that the message is actually sent. However, PostMessage()
can fail, so how should I handle the case when it fails, should I place it in a while loop that does not exit until PostMessage()
returns success?
Upvotes: 1
Views: 217
Reputation: 385405
Since you can't guarantee delivery, as you indicate yourself, you need to instead decide how bad failure is. It sounds pretty critical, so I'd simply terminate the app. What else could you do?
Upvotes: 2