PDA

View Full Version : Bug in D2005 version of Windows.pas



Sly
10-03-2005, 10:56 PM
Just a heads up for anyone using GDI functions in D2005.

I found a bug in the D2005 version of Windows.pas last night when recompiling my IRC client (last time it was compiled was in Delphi 5 or 6 I think). The tagBITMAP record is declared as a packed record, which when passed to GetObject() causes that function to fail because the record is too short. Remove the packed directive and all is good.

For more info see http://qc.borland.com issue #11282.

savage
10-03-2005, 11:05 PM
That's an interesting one.
I had a discussion with Danny Thorpe in September last year, about packed records where he assured me that when when passing any structure from Delphi to an external API, it should *always* be marked packed.

So now there seems to be exceptions to that rule.

Anyways, thanks for the heads up.