Click here to Skip to main content
15,892,697 members

TMS glass buttons do not show

Misol1 asked:

Open original thread
Hello all,

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.

My questions:
- 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,

Best regards,

Tomek
Tags: Delphi, GDI, GDI+, Event, Handler

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900