Click here to Skip to main content
16,005,734 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalbitmap file format Pin
peterworth18-Aug-04 3:21
peterworth18-Aug-04 3:21 
GeneralRe: bitmap file format Pin
Chris Losinger18-Aug-04 4:27
professionalChris Losinger18-Aug-04 4:27 
GeneralRe: bitmap file format Pin
Anonymous18-Aug-04 4:46
Anonymous18-Aug-04 4:46 
GeneralRe: bitmap file format Pin
Chris Losinger18-Aug-04 4:54
professionalChris Losinger18-Aug-04 4:54 
GeneralRe: bitmap file format Pin
Anonymous18-Aug-04 4:57
Anonymous18-Aug-04 4:57 
GeneralRe: bitmap file format Pin
Chris Losinger18-Aug-04 5:03
professionalChris Losinger18-Aug-04 5:03 
GeneralRe: bitmap file format Pin
Anonymous18-Aug-04 5:08
Anonymous18-Aug-04 5:08 
GeneralRe: bitmap file format Pin
Chris Losinger18-Aug-04 5:14
professionalChris Losinger18-Aug-04 5:14 
#pragma pack(n) tells the compiler to arrange your structs so that the struct members each start on addresses that are multiples of 'n'. your problem was that the members of the struct weren't in the right places to be filled by your file read function, because they weren't aligned the way you assumed they were.

the default packing size is 8; so, in effect, each member of a struct takes a minimum of 8 bytes. you can change this on a project-wide level in Project / Settings / C/C++ / Code Generation, or on specific structs using the #pragma pack constructs.

this is one of those things we all have to learn the hard way, since it's not exactly well-advertized Smile | :)


Software | Cleek

GeneralRe: bitmap file format Pin
Rick York18-Aug-04 10:22
mveRick York18-Aug-04 10:22 
GeneralHELP NEEDED, With Windows Default Settings. Pin
Yaxcidia18-Aug-04 2:52
Yaxcidia18-Aug-04 2:52 
GeneralRe: HELP NEEDED, With Windows Default Settings. Pin
David Crow18-Aug-04 6:19
David Crow18-Aug-04 6:19 
GeneralRe: HELP NEEDED, With Windows Default Settings. Pin
Yaxcidia18-Aug-04 8:19
Yaxcidia18-Aug-04 8:19 
GeneralRe: HELP NEEDED, With Windows Default Settings. Pin
David Crow18-Aug-04 8:38
David Crow18-Aug-04 8:38 
QuestionDialogs Skins ??? Pin
zahid_ash18-Aug-04 2:04
zahid_ash18-Aug-04 2:04 
AnswerRe: Dialogs Skins ??? Pin
RChin18-Aug-04 3:35
RChin18-Aug-04 3:35 
GeneralRe: Dialogs Skins ??? Pin
zahid_ash18-Aug-04 18:32
zahid_ash18-Aug-04 18:32 
GeneralProblem:big dll size Pin
happycpp18-Aug-04 1:50
happycpp18-Aug-04 1:50 
GeneralRe: Problem:big dll size Pin
Michael P Butler18-Aug-04 1:56
Michael P Butler18-Aug-04 1:56 
GeneralRe: Problem:big dll size Pin
happycpp18-Aug-04 4:16
happycpp18-Aug-04 4:16 
GeneralRe: Problem:big dll size Pin
David Crow18-Aug-04 6:22
David Crow18-Aug-04 6:22 
GeneralRe: Problem:big dll size Pin
gamitech19-Aug-04 12:42
gamitech19-Aug-04 12:42 
Generalinsert branch parameter in Microsoft RTC Client API 1.2 Pin
elza18-Aug-04 1:40
elza18-Aug-04 1:40 
GeneralRe: insert branch parameter in Microsoft RTC Client API 1.2 Pin
Hasini Gunasinghe14-Jan-09 21:34
Hasini Gunasinghe14-Jan-09 21:34 
QuestionHow to add text in video capture Pin
zahid_ash18-Aug-04 1:25
zahid_ash18-Aug-04 1:25 
GeneralHI , Problm in Drag and Drop ,,,, DragQuryFile Pin
zahid_ash18-Aug-04 0:15
zahid_ash18-Aug-04 0:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.