Re: PostMessage and unprocessed messages



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
.



Relevant Pages

  • Re: Frameset download complete
    ... Private Sub AxWebBrowser1_DocumentComplete(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Handles AxWebBrowser1.DocumentComplete ... But how can I get the top-level browser. ... >> frameset and frame complete. ... > DocumentComplete on the parent frame fires after DocumentComplete on all ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Data Validity and Freshness
    ... Sender should be repsonsible to have a validity bit set with each ... frame to show the frame has valid data. ... Receiver should extract the CRC and see if the CRC has incremented ... Receiver should discard any incomming data if the validity criteria ...
    (comp.arch.fpga)
  • Re: [Socketcan-users] [PATCH] CAN: make checking in can_rcv less restrictive
    ... Checking for can frame format in can_rcvis too restrictive. ... In our case a sender generates correct can frames carrying ... This way the can driver on our side runs into the bug ...
    (Linux-Kernel)
  • Re: How can a message receiver know the sender?
    ... Emptist> receiver know the sender for simpler code. ... frame:= Processor activeProcess topFrame sender. ... Based on anInteger you can get the caller chain. ...
    (comp.lang.smalltalk)