On the same note of not being able to restrain myself, Alex Kouznetsov
grumbled:
> Could not restrain myself from making another note on how reduculas this
> problem is and how shameful Borland should feel about it.
In the final analysis the problem is Borland's as it is their product that
we are using, but the entire problem here is caused by Microsoft and video
driver writers.
So that everyone understands where the problem is coming from I'm going to
explain it as simply as I can. And as a side note you should also know
that we have hit the exact same problem on customers machines where they
are using our software, so its not just restricted to Delphi alone!
Because Delphi has dynamic registration of components it must build a
image list up at run time, image by image as it processes the
registrations in the packages (or library for Delphi 3) that are loaded.
To do this they must use the standard, documented image list API's.
To increase drawing speed video drivers cache the image lists bitmap in
the video card RAM. This is achieved by what I'm assuming is fairly
hideous display device driver code, and the techniques used are probably
not particularly well documented by Microsoft.
As a images lists size increases dynamically it will eventually reach a
point at which the bitmap being cached by the video driver is too large to
remain in the video card memory and the card's caching must be adjusted to
recognise this.
It's at this point that things start going wrong. If the video card driver
doesn't manage this transition from cached to uncached bitmap status
subsequent draws from the image list will be using the now completely
bogus cache on the video card. At that point you start getting strange
black icons, the wrong icons completely and just garbage depending on
exactly what the video driver is doing wrong when you draw.
As Profax has discovered you can also achieve a similar problem by simply
loading an image list that is too large for old versions of ComCtl32 to
handle cleanly and you end with all sorts of garbage being drawn onto the
screen.
When this happen you have a two options that you can look into to see if
the problem can be fixed.
Option 1: Check the ComCtl32.DLL version. Versions older than 4.72 had
various problems with large image lists that cause this sort of bug.
Microsoft has various updates available to the 4.X series and the new 5.X
serious (internally part of Win2K, but used by IE 5) for you to download.
Our software actually checks at start up and grumps if the user has an old
version.
Option 2: Check for newer video driver from the manufacturer. Very often
the drivers that come with a machine are several months old and this bug
has been fixed by the time that you find it. If you are feeling especially
paranoid you can check that the problem is not Delphi's by running using
the standard Microsoft standard SVGA driver and checking that the problem
is not there. This confirms that the video driver is the problem and that
you have a valid grump against the author of the driver.
If neither of these fixes the problem then you have a serious problem that
will probably require money to fix. As mentioned earlier the Matrox and
nVidia drivers are known to be especially stable in this area so a new
video card is a certain solution.
As a final note I must return to the original complaint that its Borland's
fault. I agree that it's their software, but it is very hard for any
vendor to guarantee that any their application will work with every
possible combination of Windows version, device driver and installed
software. If you have written to the approved API's provided why should
you have to cater for other peoples bugs?
The usual answer to that is that its your software that is looking bad and
taking the rap for the problem. Its an image issue that can be very
damaging to your software's and company's reputation.
Borland made the choice, as Profax did, of using image lists because its
the only simple way of displaying images on various other Microsoft
objects (like menus, tool bars and trees) and unless Borland commits to
completely replacing all of the Windows control with native Delphi code
this problem is going to turn up again and again when other people bugs
interfere. I don't see this happening from the Borland end of things, even
is we Profax developers have gone down that path 8-)
And on a final note I'd like to point out that on one combination of
machine hardware and drivers (new too I might add!) we actually found a
bug where just loading the image list from our resource stream was causing
the video driver to completely corrupt the floating point stack! All we
could do at that point was to check that the standard SVGA driver worked
properly and point out to the vendor concerned that there were newer
drivers available that should fix the problem and it wasn't our fault.
What else can you possibly do?
Cheers, Max.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz