> Ummm... no. You can get a range of messages, but if the messages you
> want to AVOID pulling from the queue are in the middle of the range,
> there's no one range that gets all messages around yours.
>
> But, having thought about it, you could issue two
> GetMessage() calls with the ranges on either side of the ones you want
> to avoid...

Yeah, that was what I had in mind.

> I use PeekMessage(). I haven't had cause to post thread messages so I
> don't need the extra power of GetMessage() {:v)

PeekMessage( ) is also capable of filtering the messages.  BTW, check out
the MsgWaitForMultipleObjects( ) function.  This allows you to wait for a
message and some kernel objects at the same time.  You can also use its
queue status parameter which might be handy (if not in your current case, in
the future.)

> "Yeah, definitely.  You should call GetOverlappedResult( ) after your
> wait function returns successfully, and pass FALSE as its last
> argument."
>
> But I realise now, you meant AFTER waiting on the handle, then finally
> call this, so you really did mean FALSE, not TRUE - that was where I
> got mixed up and thought you had recommended it. Now I've checked
> back, I see you did indeed not recommend that.

Yes, like I said, you need to call GetOverlappedResult( ) after the wait
function returns to check the results of the I/O, so it doesn't make sense
to set the last parameter to true then.

> Why not just use CFile's ReadHuge()?

I doubt CFile supports overlapped I/O, but at any rate, MSDN states that
this function is obsolete, and CFile::Read( ) (which maps to a ReadFile( ))
must be used instead.  Anyway, I almost never use CFile, so I don't have any
idea of its performance, but I'm sure anything that uses a blocking I/O
would not outperform overlapped I/O.

-------------
Ehsan Akhgari

Farda Technology (http://www.farda-tech.com/)

List Owner: [email protected]

[ Email: [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]

Man is something that must be overcome: and therefore you will love your
virtues,- for you will perish by them.-
-Thus Spoke Zarathustra, F. W. Nietzsche




_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for 
subscription changes, and list archive.

Reply via email to