Click here to Skip to main content
15,894,460 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: load bmp picture. Pin
David Crow28-Dec-09 10:04
David Crow28-Dec-09 10:04 
Questionstructure checking Pin
kk.tvm28-Dec-09 1:04
kk.tvm28-Dec-09 1:04 
AnswerRe: structure checking [modified] Pin
KingsGambit28-Dec-09 1:09
KingsGambit28-Dec-09 1:09 
GeneralRe: structure checking Pin
Madhu Nair28-Dec-09 4:13
Madhu Nair28-Dec-09 4:13 
AnswerRe: structure checking Pin
Richard MacCutchan28-Dec-09 1:10
mveRichard MacCutchan28-Dec-09 1:10 
GeneralRe: structure checking Pin
Luc Pattyn28-Dec-09 3:29
sitebuilderLuc Pattyn28-Dec-09 3:29 
GeneralRe: structure checking Pin
CPallini28-Dec-09 3:47
mveCPallini28-Dec-09 3:47 
GeneralRe: structure checking Pin
Bram van Kampen28-Dec-09 13:26
Bram van Kampen28-Dec-09 13:26 
Well,

I've never known it to go wrong, BUT:

Padding bytes are technically 'Undefined', meaning that the underlying architecture can do with them what it wants.

e.g. We have a structure with a single char, followed by three packing bytes. The compiler is at liberty in the interest of optimisation to store the contents of the entire EAX reg to the single char, without clearing the three upper bytes first, thereby loading garbage into the three padding bytes.

I repeat the architecture is at liberty to do so, although in my experience MS compilers sofar apparently never play that dirty. It could become a portability issue though, both to future MS Compilers, or, if the code needs porting to another platform (Linux, Win64?).

Smile | :)

Bram van Kampen

GeneralRe: structure checking Pin
CPallini28-Dec-09 20:44
mveCPallini28-Dec-09 20:44 
GeneralRe: structure checking Pin
Richard MacCutchan28-Dec-09 5:17
mveRichard MacCutchan28-Dec-09 5:17 
GeneralRe: structure checking Pin
Luc Pattyn28-Dec-09 5:29
sitebuilderLuc Pattyn28-Dec-09 5:29 
GeneralRe: structure checking Pin
Richard MacCutchan28-Dec-09 5:42
mveRichard MacCutchan28-Dec-09 5:42 
GeneralRe: structure checking Pin
Luc Pattyn28-Dec-09 5:44
sitebuilderLuc Pattyn28-Dec-09 5:44 
GeneralRe: structure checking Pin
Richard MacCutchan28-Dec-09 6:26
mveRichard MacCutchan28-Dec-09 6:26 
AnswerRe: structure checking Pin
CPallini28-Dec-09 1:28
mveCPallini28-Dec-09 1:28 
GeneralRe: structure checking Pin
kk.tvm30-Dec-09 19:45
kk.tvm30-Dec-09 19:45 
QuestionNamed pipes cross domains Pin
vikramlinux27-Dec-09 22:56
vikramlinux27-Dec-09 22:56 
QuestionSQL + _RecordsetPtr [modified] Pin
NVCprog27-Dec-09 22:34
NVCprog27-Dec-09 22:34 
QuestionA Bug with MFC Aero Wizards ? Pin
Ahmed Charfeddine27-Dec-09 22:18
Ahmed Charfeddine27-Dec-09 22:18 
AnswerRe: A Bug with MFC Aero Wizards ? Pin
Greg Marr13-Jan-10 12:08
Greg Marr13-Jan-10 12:08 
QuestionPragmas in C Pin
Razanust27-Dec-09 21:19
Razanust27-Dec-09 21:19 
AnswerRe: Pragmas in C [modified] Pin
Nuri Ismail27-Dec-09 21:36
Nuri Ismail27-Dec-09 21:36 
AnswerRe: Pragmas in C Pin
sashoalm27-Dec-09 23:06
sashoalm27-Dec-09 23:06 
AnswerRe: Pragmas in C Pin
Richard MacCutchan27-Dec-09 23:19
mveRichard MacCutchan27-Dec-09 23:19 
AnswerRe: Pragmas in C Pin
Bram van Kampen28-Dec-09 1:31
Bram van Kampen28-Dec-09 1:31 

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.