Question about DoEvents
- From: "Lance Wynn" <LanceWynn@xxxxxxxxxxxxxxxx>
- Date: Wed, 8 Feb 2006 15:54:39 -0700
Hello,
I have a program running that calls to an ActiveX.exe. The activex exe has
a timer event in it that kicks off a process that reads from a queue and
does some processing, it also has a method that adds an item to the queue
from a client app. It looks like this:
'Client
sub additem(item as object)
mAXexe.addToQueue item
end sub
Server
public sub addToQueue(item as object)
'code to add item to queue.
doevents
end sub
private sub timer1_timer()
'loop through queue
do until endofqueue
'processqueueitem
doevents
loop
end sub
Now, this has been running for some time now without a problem, but the
other day, the client app was hung with the "Switch to/retry" box. The only
external call from the client is made to add an item to the server's queue.
I wonder if perhaps the doevents in the addToQueue sub in the server is
firing, and control is going to the timer event (If the timer event fires at
the exact time an item is added) and then control will not be returned to
the addToQueue event until the processing is done (which can take several
minutes or more.)
I have removed the doEvents from the addToQueue method, and the problem
hasn't re-occurred, but it only happened the one time anyway, so I don't
know if I've fixed the problem or not. Is my diagnosis accurate as to what
could be happening, or do you think I should keep digging around in there?
Lance
.
- Follow-Ups:
- Re: Question about DoEvents
- From: Larry Serflaten
- Re: Question about DoEvents
- From: Michael C
- Re: Question about DoEvents
- Prev by Date: Program gets stuck in this loop
- Next by Date: Re: Confused: Updating VB6
- Previous by thread: Program gets stuck in this loop
- Next by thread: Re: Question about DoEvents
- Index(es):
Relevant Pages
|