1. Send/PostMessage question
- Posted by akusaya at gmx.net
Feb 04, 2005
Hi,
I'm tring to communicate my VB program with Eu program, but since I'm
not expert at VB and Win API, I wanted to use SendMessage /
PostMessage to send data from/to those processes.
1. What is the difference between SendMessage and PostMessage?
2. If I send, for example, 1000 messages from the VB program to Eu
program using for loop (so no delay between them),
- will they be received in order?
- will they always be received? (no one message is lost)
Thanks in advance.
2. Re: Send/PostMessage question
On Fri, 4 Feb 2005 12:21:56 +0800, aku saya <akusaya at gmx.net> wrote:
>
>
>Hi,
>
>I'm tring to communicate my VB program with Eu program, but since I'm
>not expert at VB and Win API, I wanted to use SendMessage /
>PostMessage to send data from/to those processes.
>
>1. What is the difference between SendMessage and PostMessage?
SendMessage will wait for the target handler to process the message
and return the result from that. Post message will just dump it on the
queue and return 1, or 0 if an error (eg no such window) occurs.
>
>2. If I send, for example, 1000 messages from the VB program to Eu
>program using for loop (so no delay between them),
> - will they be received in order?
SendMessage is a given, but I wouldn't count on it for Postmessage.
> - will they always be received? (no one message is lost)
Both programs in any case should cope with the other program crashing
after processing half the messages.
If you have a large amount of data, it would be better to dump it to a
file, then post a message to signal the file should be read. Better,
use a pipe, or even better still, have a look for ipc in the archives,
and see if you can mimic that on the VB side.
Regards,
Pete