Click here to Skip to main content
15,908,618 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unit tests Pin
Henry miller24-Jan-05 4:47
Henry miller24-Jan-05 4:47 
GeneralRe: Unit tests Pin
Ravi Bhavnani24-Jan-05 5:11
professionalRavi Bhavnani24-Jan-05 5:11 
GeneralConfused with some GDI functions Pin
LiYS21-Jan-05 17:15
LiYS21-Jan-05 17:15 
GeneralRe: Confused with some GDI functions Pin
Bob Ciora21-Jan-05 18:59
Bob Ciora21-Jan-05 18:59 
GeneralRe: Confused with some GDI functions Pin
LiYS21-Jan-05 22:48
LiYS21-Jan-05 22:48 
General#pragma pack(1) packing wrong structure sizes ! ! ! Pin
Alan Chambers21-Jan-05 14:58
Alan Chambers21-Jan-05 14:58 
GeneralRe: #pragma pack(1) packing wrong structure sizes ! ! ! Pin
Tim Smith21-Jan-05 15:10
Tim Smith21-Jan-05 15:10 
GeneralRe: #pragma pack(1) packing wrong structure sizes ! ! ! Pin
Alan Chambers21-Jan-05 23:59
Alan Chambers21-Jan-05 23:59 
Hey thankyou for the tip off. It came like a dose of paracetemol to me Smile | :) . Here are my answers to some of your questions.

1. Because i didn't see the point in declaring a 16 bit type with a bitfield of less than 8 bits when the 8 bit type is nearer the size i wanted (well that was the thinking).

2. I was assuming the compiler would notice it was trying to pack a 16 bit struct and therefore pack it on a 2 byte boundary as I was requesting.

3. Mmm the weird thing was that I saw that you're supposed to use the 'unsigned' declaration with no size typing so the compilers can make the same choices in their different ways. I think I was just extremely tired, either that or ignorant Smile | :) . I also never bother referencing the c++ standard when using a Microsoft compiler because its tends to break it at will, although the .NET 2003 Visual Studio one is much more compliant (and I'm hoping 2005 will be even better with platform independant project management yay Smile | :) ). I could see that the two compilers had implemented it in their different ways, I just wanted to know what I had to do to get the microsoft implementation to give me the same semantics as gcc.

I was only trying to make a tool for my blinking program, but became frustrated as I wasted the entire evening after coming home from work at 9.30pm (long day) doing something simple like this until 2am (British time). Your response solved it in two seconds. I think it is a lesson learned now though, I shall use the 'unsigned' type declaration instead of a u16 or u8 declaration and leave the packing all up to the compiler.

Thanks again though Smile | :)


"When I left you I was but the learner, now I am the master" - Darth Vader
GeneralRe: #pragma pack(1) packing wrong structure sizes ! ! ! Pin
Alan Chambers28-Jan-05 11:05
Alan Chambers28-Jan-05 11:05 
QuestionHow to use shared-memory to map uncertain page file Pin
shusong21-Jan-05 14:06
shusong21-Jan-05 14:06 
AnswerRe: How to use shared-memory to map uncertain page file Pin
Bob Ciora21-Jan-05 19:47
Bob Ciora21-Jan-05 19:47 
QuestionHow to draw a ListView frame Pin
Björn Eiríksson21-Jan-05 13:25
sussBjörn Eiríksson21-Jan-05 13:25 
QuestionHow to perform qsort on a CList of class objects? Pin
wsquare21-Jan-05 12:51
wsquare21-Jan-05 12:51 
AnswerRe: How to perform qsort on a CList of class objects? Pin
wsquare21-Jan-05 12:56
wsquare21-Jan-05 12:56 
AnswerRe: How to perform qsort on a CList of class objects? Pin
Anonymous21-Jan-05 13:31
Anonymous21-Jan-05 13:31 
AnswerRe: How to perform qsort on a CList of class objects? Pin
Bob Ciora21-Jan-05 18:48
Bob Ciora21-Jan-05 18:48 
GeneralRe: How to perform qsort on a CList of class objects? Pin
wsquare21-Jan-05 19:58
wsquare21-Jan-05 19:58 
GeneralRe: How to perform qsort on a CList of class objects? Pin
markkuk22-Jan-05 0:03
markkuk22-Jan-05 0:03 
GeneralRe: How to perform qsort on a CList of class objects? Pin
Bob Ciora22-Jan-05 3:25
Bob Ciora22-Jan-05 3:25 
GeneralRe: How to perform qsort on a CList of class objects? Pin
markkuk23-Jan-05 4:31
markkuk23-Jan-05 4:31 
GeneralRe: How to perform qsort on a CList of class objects? Pin
Bob Ciora22-Jan-05 4:22
Bob Ciora22-Jan-05 4:22 
QuestionHow do I assign char array address to int? Pin
ErikDabrowsky21-Jan-05 10:26
ErikDabrowsky21-Jan-05 10:26 
AnswerRe: How do I assign char array address to int? Pin
Michael Dunn21-Jan-05 11:00
sitebuilderMichael Dunn21-Jan-05 11:00 
GeneralRe: How do I assign char array address to int? Pin
ErikDabrowsky21-Jan-05 11:29
ErikDabrowsky21-Jan-05 11:29 
AnswerRe: How do I assign char array address to int? Pin
markkuk22-Jan-05 0:19
markkuk22-Jan-05 0:19 

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.