Article View: borland.public.cppbuilder.nativeapi
Article #15687Structure and sizeof mis-behaving
From: Chris
Date: Mon, 16 Jun 2003 03:05
Date: Mon, 16 Jun 2003 03:05
18 lines
1698 bytes
1698 bytes
I found out why my DIB to bitmap function isn't working...
CBuilder6 is reporting the size of BITMAPFILEHEADER two bytes bigger than it
actually is, and there are two extra junk bytes at the beginning of the
structure data that shouldn't be there. They aren't there in CBuilder5, and
the size is reported properly, too.
I tried my own variant, shown below.
If I comment out bfReserved1, the size is still 16, but if I comment out
bfType too, the size goes down to 12, when it should be at ten.
Can anyone help me figure out how to fix this???
typedef struct tag2BITMAPFILEHEADER {
// WORD bfType;
DWORD bfSize;
// WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
} BITMAPFILE2HEADER, FAR *LPBITMAPFILE2HEADER, *PBITMAPFILE2HEADER;
Technical Details
Message-ID:
<3eed33f3$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,316b0e1c5551c37a,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-06-15 20:13:07 PST From: "Chris" <Chris8852@adelphia.net> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Structure and sizeof mis-behaving Date: Sun, 15 Jun 2003 23:05:24 -0400 Lines: 20 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 68.65.164.124 Message-ID: <3eed33f3$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1055732723 68.65.164.124 (15 Jun 2003 20:05:23 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail