Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2007 Apr : ProcessMessages

www.cryer.info
Managed Newsgroup Archive

ProcessMessages

Subject:ProcessMessages
Posted by:"Anders Balslev" (i..@business.tele.dk)
Date:Thu, 5 Apr 2007 13:33:13

DBS2006 Upd 3
WinXP Pro

Hi All

I would like to know the exact nature of following command:

- Application.ProcessMessages

I do have following small piece of code:

----
Repeat
  Application.ProcessMessages;
Until (someCondition) or Timeout
----
The (someCondition) occurs when a certain event is fired (precisely - when
an external devixe has sent an RS232-message. but discard this detail).
TimeOut occurs when the time waiting for (someCondition) has elapsed

In rare situation (but often enough that it gives problems), the time for
executing "Application.Processmessages" exceeds the Timeout by several
seconds, sometimes minutes!! (normally my timeout is 5 seconds, but in the
abovementiones rare situations, the "Application.ProcessMessages" takes 45 -
60 seconds!!).
This is based upon carefully debugging of my application.

In my own application, there are no routines (to my own knowledge -:)) that
spends that long time to execute, indeed not triggered by any events. So my
question is : will it be possible that other application running
concurrently on the same PC can cause "Application.ProcessMessages" to spend
a lot of time and block for further execution in my own application?

Any ideas are highly appreciated

Anders Balslev

Replies:

www.cryer.info
Managed Newsgroup Archive