Why doesn't PostThreadMessage work consistently?
Posted on 1998-12-31
I need to send notifications from a worker thread to the main thread of my MFC application. Using PostThreadMessage usually works, but sometimes the messages never get received. In particular, if the main thread is displaying a dialog box and the user is moving the dialog box around the screen continuously, any and all messages posted from the worker thread to the main thread using PostThreadMessage never get received by the main thread.
Am I doing something incorrectly or is this just the way PostThreadMessage works? If the latter, what alternatives do I have? I do not want to lock up the UI, that is the reason for the worker thread.
Thanks in advance...