Re: Question about DoEvents

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks for the reply,

I just needed some outside opinion about it so I wouldn't worry about it.


If the queue is processing, it will accept additional queue items, and will
return control to the client pretty instantly. The time I saw the problem,
there were no items in the queue for processing, and when I looked at the
doevents in the addItem method, it made me think that the doevents fired
just as the timer event was firing to check for additional items (which it
found as the item was added in the previous line)

Lance

"Michael C" <nospam@xxxxxxxxxx> wrote in message
news:uDjDeoQLGHA.2668@xxxxxxxxxxxxxxxxxxxxxxx
"Lance Wynn" <LanceWynn@xxxxxxxxxxxxxxxx> wrote in message news:e5%
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?

That sounds perfectly feasible, there is no reason to have DoEvents there
anyway. But wouldn't this happen if an item in the queue was running anyway?


Lance





.



Relevant Pages

  • Re: Code executing too fast -- causes errors
    ... is also a queue of messages waiting to be processed. ... As you say, sleep suspends execution for a given duration, then resumes ... The key difference between the two approaches is that DoEvents will permit ... Private Sub CommandButton1_Click ...
    (microsoft.public.word.vba.beginners)
  • Question about DoEvents
    ... it also has a method that adds an item to the queue ... sub additem ... and control is going to the timer event (If the timer event fires at ...
    (microsoft.public.vb.general.discussion)
  • Re: Menu browsing pauses application
    ... The Doevents don't seem to give up any time slices for the user ... If the queue is empty, ... OTOH calling it too infrequently may mean the ... How often are you calling Sleep? ...
    (microsoft.public.vb.general.discussion)
  • Re: Question about DoEvents
    ... DoEvents in your queue processing code, but I suspect you have it ... Does DoEvents work with ActiveX calls though? ... The problem as I saw it was that processing one item from the queue could ... and control is going to the timer event (If the timer event fires at ...
    (microsoft.public.vb.general.discussion)
  • Re: Question about DoEvents
    ... the client app was hung with the "Switch to/retry" box. ... I wonder if perhaps the doevents in the addToQueue sub in the server is ... and control is going to the timer event (If the timer event fires ...
    (microsoft.public.vb.general.discussion)