Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

not enough timers available

2,670 views
Skip to first unread message

Michael Fullerton

unread,
Apr 2, 2001, 5:25:50 PM4/2/01
to
A couple of customers have reported seeing a "not enough timers
available" error in one app. The app uses only one timer on the main
form and no threads. Any ideas?

___
The Delphi Compendium
http://www.cyber-matrix.com/delphi.htm

Shane

unread,
Apr 2, 2001, 6:18:27 PM4/2/01
to
> The app uses only one timer on the main form and no threads.

If that's the case, I think it's safe to assume the problem lies with some
other software he is running.

Shane


Martin Lafferty

unread,
Apr 3, 2001, 4:32:21 AM4/3/01
to

> A couple of customers have reported seeing a "not enough timers
> available" error in one app. The app uses only one timer on the main
> form and no threads. Any ideas?

The VCL timer component reports this message whenever anything goes wrong
with a timer
regardless of the nature of the problem: if you have the VCL source then
look at the function TTimer.UpdateTimer. The timer has a private field
FWindowHandle which is a handle to the window
used to handle the timer messages. Whenever UpdateTimer is called (i.e
whenever the timer is enabled or its update rate is changed) UpdateTimer
calls Windows.SetTimer(FWindowHandle, etc.... ) if this
call fails then you will get a 'Too Many Timers' error regardless of the
actual cause of the error. This is a somewhat liberal assumption.

When a colleague of mine had the same problem as yours (random and
seemingly illogical occurances of 'Too many timers'), we replaced the timer
with a modified version of the std TTimer which called GetLastError after
SetTimer in TTimer.UpdateTimer. Not surprisingly, the error returned was
'Invalid Window Handle'. Eventually the problem turned out to be corruption
of the Timer's window handle (FWindowHandle) by a memory overwriting bug. I
think I would be tempted to put a MemoryChanged breakpoint on FWindowHandle
to start with.

Happy Hunting.

Martin Lafferty

Martin Lafferty

unread,
Apr 3, 2001, 3:52:28 AM4/3/01
to
> A couple of customers have reported seeing a "not enough timers
> available" error in one app. The app uses only one timer on the main
> form and no threads. Any ideas?

The VCL timer component reports this message whenever anything goes wrong

Russell E. Holcomb

unread,
Apr 3, 2001, 9:04:02 AM4/3/01
to
If this is Win32 then somebody is eating thousands of timers. If Win16 you
maybe out of luck.

Russ

"Michael Fullerton" <cma...@spamkiller-remove.home.com> wrote in message
news:3ac8ed34....@forums.borland.com...

Martin Lafferty

unread,
Apr 3, 2001, 9:37:13 AM4/3/01
to
Michael Fullerton:

> A couple of customers have reported seeing a "not enough timers
> available" error in one app. The app uses only one timer on the main
> form and no threads. Any ideas?

The VCL timer component reports this message whenever anything goes wrong

Reddy Palle

unread,
Apr 3, 2001, 4:26:16 PM4/3/01
to

"Martin Lafferty" <mar...@prel.co.uk> wrote in

> Eventually the problem turned out to be corruption
> of the Timer's window handle (FWindowHandle) by a memory overwriting bug.
I
> think I would be tempted to put a MemoryChanged breakpoint on
FWindowHandle
> to start with.

What is a "MemoryChanged" breakpoint? How do you set it? Is it different
from any other break point?

-- Reddy Palle.

Martin Lafferty

unread,
Apr 3, 2001, 5:34:15 PM4/3/01
to
> What is a "MemoryChanged" breakpoint? How do you set it? Is it
different
> from any other break point?

This was a bad terminology for me to use. In the Delphi IDE these are called
DataBreakpoint - these are breakpoints which halt execution when a variable
is changed. In Delphi 5 Run|Add Breakpoint|Data Breakpoint.

regards,

Martin


Reddy Palle

unread,
Apr 3, 2001, 8:24:41 PM4/3/01
to

"Martin Lafferty" <mar...@prel.co.uk> wrote in

Martin,
Thanks for the explanation. I was wondering if it was a secret feature
;). However, I have not used Data BreakPoints much.

Regards,
--Reddy Palle

0 new messages