Re: PostMessage and unprocessed messages
- From: David Lowndes <DavidL@xxxxxxxxxxxxxxx>
- Date: Tue, 04 Mar 2008 21:11:28 +0000
I'm developing and application that read a stream from serial port,
trasform byte in a structure and send it to the top-most dialog that
uses those data. When a frame is received I create (new) my structure
and send with a postmessage to the top-most dialog (it delete the
message too). What happen if I close the dialog before all messages
are elaborated ?
Stefano,
In that case you'd have memory leaks - but I suspect you already knew
that.
Is there a way to wait until all messages are processed ?
You could use a PeekMessage loop to process all currently queued
instances of your message, but I don't think it'd be foolproof - to do
it properly you'd need to signal the sender to stop posting any more
messages, and then empty the message queue.
Dave
.
- Follow-Ups:
- Re: PostMessage and unprocessed messages
- From: Giovanni Dicanio
- Re: PostMessage and unprocessed messages
- References:
- PostMessage and unprocessed messages
- From: Stefano
- PostMessage and unprocessed messages
- Prev by Date: Re: bug in common controls
- Next by Date: assert in OnEnterIdle(UINT nWhy, CWnd* pWho)
- Previous by thread: PostMessage and unprocessed messages
- Next by thread: Re: PostMessage and unprocessed messages
- Index(es):
Relevant Pages
|