I found a serious bug in Borland C++ Builder 6 Enterpise upgrade with
Update Pack 1 was installed. You could try the following line.
int n = sizeof (BITMAPFILEHEADER);
The result is always 16. However, it should be 14. No matter what data
alignment (Byte, Word, Double Word or Quad Word) is setting and the result
reminder the same. I also had try the directives ¨#pragma〃 setting.
Nothing help. So I try to define a structure by myself and test it again.
What amazing, it works!! The problem is inside the HEADER file, not the
compiler. The following code paragraph sovle the problem.
#pragma pack(push, 2)
typedef struct tagBITMAPFILEHEADER2 { WORD bfType; DWORD bfSize;
WORD bfReserved1; WORD bfReserved2; DWORD bfOffBits; }
BITMAPFILEHEADER2, *PBITMAPFILEHEADER2; #pragma pack(pop)
int n = sizeof(BITMAPFILEHEADER2);
However, there are too much structures defined. I could not do such a stupid
thing to wrap all structures. Is anyone have non-upgrade version could test
it?
Sincerely,
Bell
How can there be an update pack 1. I thought BCB6 just came out??
> How can there be an update pack 1. I thought BCB6 just came out??
I think he means a new license version, rather than a BCB5->6 upgrade.
Of course, I could be wrong as well :¬ )
--
AlisdairM
Team Mongolian Wok
For the problem mentioned, see the thread "bcb6, #pragma pop ... alignment
bug".
Jeroen.
"Alisdair Meredith"
<alisdair.no.spam.please.we're.britis...@uk.renaultf1.com> wrote in
message news:3CA461A5...@uk.renaultf1.com...
> "R. Tulloch" wrote:
>
> > How can there be an update pack 1. I thought BCB6 just came out??
>
> I think he means a new license version, rather than a BCB5->6 upgrade.
>
> Of course, I could be wrong as well :Ź )
Edit your pshpack*.h and poppack.h header files and remove the enclosing
#pragmas. Then re-make your project.
I made a point of saying in another post about this that Borland should
notify BCB6 programmers about this bug or else many others will run into
it unawares as you have done. Your post is an example of what I was
talking about.
Why they were added to begin with, and how they made it through the testing
phases without detection, noone knows.
Gambit
"Cheng-Yuan Bell Hsu" <be...@ebmtech.com> wrote in message
news:3ca44f1c_1@dnews...