Click here to Skip to main content
15,915,019 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CDialog Help urgent???? Pin
Martin Koorts12-Jan-05 1:34
Martin Koorts12-Jan-05 1:34 
GeneralRe: CDialog Help urgent???? Pin
nutkase12-Jan-05 17:47
nutkase12-Jan-05 17:47 
GeneralWindow style Internet Explorer Pin
vyjesh11-Jan-05 21:23
vyjesh11-Jan-05 21:23 
GeneralCallBack Definition. Pin
Neelesh K J Jain11-Jan-05 21:00
Neelesh K J Jain11-Jan-05 21:00 
GeneralRe: CallBack Definition. Pin
Abhi Lahare11-Jan-05 23:59
Abhi Lahare11-Jan-05 23:59 
GeneralRe: CallBack Definition. Pin
Chris Losinger12-Jan-05 1:05
professionalChris Losinger12-Jan-05 1:05 
GeneralRe: CallBack Definition. Pin
Antony M Kancidrowski12-Jan-05 2:34
Antony M Kancidrowski12-Jan-05 2:34 
General#pragma question Pin
alex.barylski11-Jan-05 20:30
alex.barylski11-Jan-05 20:30 
#pragma pack(push|pop)

From what I remember...the last time I read up on what this pragma does was long time. Wink | ;)

Anyways...my understanding is that it forces a even byte alignment of structures, it's mebers, etc.

I've seen it used often in a structure and like I said...my understanding is that it causes data members to fall on quad byte boundries or whatever...for faster access times...

I think it's a CPU quirk that data accessed on an even 4 byte boundry is more efficient on 32 bit processers???

Sp my question is this...assuming I am correct in my above thinking...

Would it make a logical difference if I were to remove pragma's like this??? I find them annoying...and despite making code more efficient I'm not sure I think it's worth the harder to read code (I like things easy).

If this is the case...one more question:

The pragma surrounds structs which are then used in a MFC CArray...to holds potentially 1000's of elements...

So does this pragma make sure each of those elements will be accessed on an even byte boundry???

Or I guess...would it atleast make sure the first struct item in array was on an even byte boundry, so the rest that followed???

One more question: Smile | :)

If a struct was 5 bytes would this pragma actually allocate 8 bytes for a single element, in this case using more memory in the trade off of speed in access times???

so 2 elements would actually consume 16 bytes instead of 10? wasting 3 bytes, but causing each to fall on even byte boundries???

Just curious...hope i'm on the right track here Blush | :O

Thanks in advance Smile | :)

It's frustrating being a genius and living the life of a moron!!!
GeneralRe: #pragma question Pin
Martin Koorts12-Jan-05 0:18
Martin Koorts12-Jan-05 0:18 
GeneralRe: #pragma question Pin
mirex12-Jan-05 1:45
mirex12-Jan-05 1:45 
GeneralRe: #pragma question Pin
Alan Chambers28-Jan-05 11:14
Alan Chambers28-Jan-05 11:14 
GeneralRe: #pragma question Pin
Rick York12-Jan-05 12:12
mveRick York12-Jan-05 12:12 
QuestionHow to Access data of Doc in a thread Pin
IsaacLitingjun11-Jan-05 19:21
IsaacLitingjun11-Jan-05 19:21 
AnswerRe: How to Access data of Doc in a thread Pin
Cedric Moonen11-Jan-05 20:12
Cedric Moonen11-Jan-05 20:12 
GeneralRe: How to Access data of Doc in a thread Pin
IsaacLitingjun11-Jan-05 20:52
IsaacLitingjun11-Jan-05 20:52 
GeneralRe: How to Access data of Doc in a thread Pin
Cedric Moonen11-Jan-05 21:07
Cedric Moonen11-Jan-05 21:07 
GeneralRe: How to Access data of Doc in a thread Pin
IsaacLitingjun11-Jan-05 21:23
IsaacLitingjun11-Jan-05 21:23 
AnswerRe: How to Access data of Doc in a thread Pin
Ryan Binns11-Jan-05 20:14
Ryan Binns11-Jan-05 20:14 
GeneralRe: How to Access data of Doc in a thread Pin
IsaacLitingjun11-Jan-05 21:01
IsaacLitingjun11-Jan-05 21:01 
QuestionCpu usage? Pin
dSolariuM11-Jan-05 19:10
dSolariuM11-Jan-05 19:10 
AnswerRe: Cpu usage? Pin
Jetli Jerry12-Jan-05 0:10
Jetli Jerry12-Jan-05 0:10 
AnswerRe: Cpu usage? Pin
David Crow12-Jan-05 5:43
David Crow12-Jan-05 5:43 
GeneralListBox problem Pin
Ivan Cachicatari11-Jan-05 18:54
Ivan Cachicatari11-Jan-05 18:54 
GeneralRe: ListBox problem Pin
basementman12-Jan-05 4:01
basementman12-Jan-05 4:01 
GeneralRe: ListBox problem Pin
Ivan Cachicatari12-Jan-05 7:27
Ivan Cachicatari12-Jan-05 7:27 

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.