Re: a *working* PostThreadMessage() implementation...?

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Wed, 1 Oct 2008 13:47:55 -0700 (PDT), Ajay Kalra <ajaykalra@xxxxxxxxx>
wrote:

On Oct 1, 1:22 pm, "Doug Harrison [MVP]" <d...@xxxxxxxx> wrote:

Better to use a hidden or message-only window and use plain old
PostMessage.


Why though? We used it on our main gui thread and had no issues. Any
particular reason for not using PostThreadMessage?

I meant it would be better than trying to roll one's own message queue to
work around the PostThreadMessage issues. In order for PTM to work right,
all message loops have to account for it, which could be a problem down the
road if you add a secondary message loop for some reason. That's in
addition to the secondary message loops Windows runs in various scenarios.
It just seems easier to designate a window to receive messages.

--
Doug Harrison
Visual C++ MVP
.