Win98 problem with ReleaseDC



Hi,

I have a problem with GDK on Win98 and WinME. I have made an animation
program
with a lot of widgets. It runs fine on Win2000 and WinNT but on Win98, the
system freezes after a while. It seems that it has something to do with
DC's.
After an hour of working, all GDI resources are gone.
I also get the following message constantly (usually when some widget is
resized or created and the UI is updated):

** WARNING **: c:\...\win32\gdkgc-win32.c:936: ReleaseDC failed

When this message is printed out lots of times, the system freezes much more
quickly then when the error is not printed out (which is probably quite
normal).
The problem is that this error is printed out at seemingly random moments.
Usually, when I've just rebooted the system and use a GtkMenuBar, the error
is printed a lot. When I don't use a GtkMenuBar, the error is much less
frequent.
Another strange thing is that the HWND that causes the failed
ReleaseDC(HWND, HDC)
is the third menu item. Even when I remove previous menu items, it's always
the third
menu item that reports the error (I reboot Win98 every time I perform
another test). When
there are only 2 menu items, the GtkToolBar underneath the menubar reports
the error. When
there is only 1 menu item, the first button of the GtkToolBar reports it (so
again, the third
widget with a "MS window", starting from the menu).
But I don't think it has anything to do with GtkMenuBar in particular.
I have implemented a dynamic user interface that is read from file. In my
test file, the menubar
is created just before the toolbar and they are the last widgets (previous
widgets include notebooks,
boxes, pixmaps, ...). With this dynamic user interface, all widgets are
first created and
after the creation phase, they are connected to each other.

I did some debugging and it seems that the error is printed out from this
function
gdk_win32_destroy_hdc
The context is:
    -> glib
    -> gdk_clear_hdc_cache_on_idle
    -> gdk_win32_clear_hdc_cache
    -> clear_hdc_cache_entry
    -> gdk_win32_destroy_hdc
    -> error message

It seems that GDK caches the HDC's for win32 windows. Can you do that on
Win98, because
in Win98/WinME the DC of a window changes constantly and a DC is "on the MS
Windows level",
already shared between windows.

Can anybody give more insight into this problem? Am I using GDK/GTK
incorrectly?  Or is there
a bug in GDK for Win98/WinME? Can anybody devise other tests that might be
helpful to pin down
this problem? Maybe my version of GDK is outdated (downloaded from Tor's
page
http://user.sgic.fi/~tml/gimp/win32/)?

Chris Flerackers
cflerackers androme be





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]