Re: Messaging question

From: fpvt2 (anonymous_at_discussions.microsoft.com)
Date: 11/05/04


Date: Thu, 4 Nov 2004 20:29:00 -0800

Thanks.
Inside the PacketReceived event, we have loop thru some
codes a few times, say 5 times.
When I ran the program, sometimes it will loop through 5
times, but another times it only loop through once.
The only thing I can think of is before the codes finish
run through all the loops, the PacketReceived event is
fired again, so it never finish looping through 5 times.

So, I wrote a simple test program with only a command
button and a text box. Everytime the Command1_MouseMove
event is fired, I change the value in the text box. In
the Text1_Change event, I write to a file 500 times.

When I ran this simple program, I moved the mouse quickly
in and out of the button a few times (say 5 times). The
program always finished the codes in Command1_MouseMove
event before the next Command1_MouseMove event is
executed. In this case, the program always finished
writing to file 500 times before the next
Command1_MouseMove event is executed.
So, even though I moved the mouse 5 times (and I am doing
this while the program is still executing codes from the
first Command1_MouseMove event), it only changed the
value of the text box once.

So, I am confused, from the simple program it seems like
VB finishes processing codes inside the event, before
another event is fired. But, on the other program with
the TCP/IP messaging control and the PacketReceived
event, it seems that before it finish executing the codes
inside this event, if the PacketReceived event is fired
again, it will not finish executing the codes from the
previous event and start processing codes from this new
event.

Which one is correct ?

Thank you very much.

>-----Original Message-----
>May be easier just to run a quick test and see what
happens...
>
>--
>Chris Hanscom - Microsoft MVP (VB)
>http://www.veign.com
>--
>
>"Paul fpvt2" <Paulfpvt2@discussions.microsoft.com> wrote
in message
>news:FC12C4E9-3F5E-4504-A636-
19B80ACDD54B@microsoft.com...
>> We are using a TCP/IP messaging control that receives
messages containing
>> stock quotes.
>>
>> The control has an event called PacketReceived that
fires when the control
>> receives a packet/message from the connected host.
Inside this event, we
>have
>> codes that process the message received.
>>
>> While processing these codes if another message is
received by the
>control,
>> will VB finish processing these codes, or will VB not
finish processing
>the
>> codes and go to the new message received instead ?
>>
>> Thank you.
>
>
>.
>