We started to encounter a bizzare problem with TAdvGlassButton buttons from TMS Software under Delphi2007. Sometimes they simply do not show, and if so, then all of them, across whole application.
The point is, that the buttons are there, they react to events (you have to know where they are, though
), but do not show.
Only the TAdvGlassButton class buttons seem to be a problem, the others like TAdvGlowButton work properly
Restarting the application sometimes helps and sometimes not, and it seems, that it happens mostly on Win XP machines (regularly on WinXP, and sometimes on Win7)
The buttons are drawn using GDI+.
So far I have done the following:
- I did the "overload" test and created a sample app with about 3000 buttons. It worked properly, so it is not a GDI/GDI+ resource problem,
- additionally I have checked with Denomo resource leak counter, there are no GDI resource leaks,
- I remote debugged the application on target XP from another PC while the bug occurred. I was able to get through the WM_PAINT handler without errors, HDCs were correct, all functions returned no error, but the buttons still did not show,
- I was not able to reproduce this error while debugging in IDE (maybe no luck),
- if I spoiled the button HDCs intentionally, then they of course do not show, so first my thought was the HDC handles must have been invalid, but my remote debugging test did not prove it,
- tried to remove everything from the WM_PAINT and draw only simple rectangle, instead of whole button, still not working,
- checked under D2010, but such problem does not occur there (or we did not reveal it yet)
- checked the difference between glow button and glass button: glow buttons use double buffering and glass buttons do not use it.
- got almost crazy about this bug.
My assumptions are so far:
- it may have something to do with double buffering,
- it depends on OS, as we did not see it on Vista
- it must be something very basic, that we simply ignored.
- what really cause this problem?
- can lack of double buffering result in such a way?
- how to reproduce it systematically?
- can it be some GDI+ DLL incompatibility problem?
- what debugging approach to use to narrow the problem?
- does anybody have encountered similar issue?
At the moment I have turned on the double buffering in TAdvGlassButton, we are checking now if it works.
Any help appreciated,