Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Re: Nailed it!

www.cryer.info
Managed Newsgroup Archive

Re: Nailed it!

Subject:Re: Nailed it!
Posted by:"Martin James" (mjames_falc..@dial.pipex.com)
Date:Tue, 27 Jun 2006 17:41:10

>
> AFAIK, a WMQ cannot be purged except by a GetMessage/PeekMessage loop.
> Since your custom messages in the queue are mixed-in with other OS and
other
> custom messages, the loop would have to get/peek messages and check each
one
> to see if it is one that should be purged, keeping a count of 'real'
custom
> messages that have been dumped, until th ecount reaches 99.  If a peeked
> message is not a custom message, it would have to be dispatched in the
> normal way.  This is just like the normal message-processing loop, so no
> advantage gained there.
>

The above is not correct.  The Get/Peek message calls have a range of filer
values and so it is easy to extract only the custom messages from the queue.
This still means 99 kernel calls to purge the queue, however.  If each call
has to iterate the queue, each one may take some time :(

Nevertheless, I was wrong - sorry!

Rgds,
Martin

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive