Boost logo

Boost :

From: Matt S Trentini (matt_trentini_at_[hidden])
Date: 2004-09-22 02:11:49

John Torjo wrote:

> Could you elaborate a bit? What do you think is the window handle limit
> under win32?

I think that perhaps Mathew is talking about the GDI object limit. At
least under Windows 2000 and earlier versions (I'm not sure about XP)
there is a firm limit of 16K handles that can be allocated system wide -
regardless of your particular specs (ie adding memory does not help).
When this limit is reached weird stuff [1] happens which can only be
fixed by a reboot.

Any object that allocates a handle under Windows (pens, brushes, dc's,
etc) consume those resources and if you've got a graphically intense GUI
using a greedy GUI library (ie one that holds it's handles for a long
duration) that limit isn't too hard to break.

If you open task manager and select to view the "GDI Objects" column you
can see how many objects each process uses.

If you, or anyone else, wants some more info or help please let me know
because it was quite a difficult nut to crack!

Googling for "gdi object limit", particularly in groups, will reveal a
heap of stuff. However, I've found only a few official documents that
describe the issue.


PS The last time I looked at your library John it didn't have a 'drawing
canvas' object. It's typically through that kind of object (and those
kind of drawing routines) that you'll run into issues. If you're only
using native Windows widgets this GDI limit is unlikely to bother you.

[1] Flashing objects, things draw in the wrong location etc.

Boost list run by bdawes at, gregod at, cpdaniel at, john at