So you have a
GDI Object (
handle) leak does not have to be in your code... Watch the counter in task manager and see what actions allocate a
GDI object but do not release on close. There is a default limit of 10.000
gdi objects per user (read terminal server session) which is set by a registry key. Maybe you should search the MS KB for
gdi object leak.