Click here to Skip to main content
15,889,826 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Smaller than a byte Pin
Waldermort27-Sep-07 10:06
Waldermort27-Sep-07 10:06 
QuestionRe: Smaller than a byte Pin
Mark Salsbery27-Sep-07 10:13
Mark Salsbery27-Sep-07 10:13 
AnswerRe: Smaller than a byte Pin
Waldermort27-Sep-07 10:15
Waldermort27-Sep-07 10:15 
GeneralRe: Smaller than a byte Pin
Mark Salsbery27-Sep-07 10:29
Mark Salsbery27-Sep-07 10:29 
GeneralRe: Smaller than a byte Pin
thestrat27-Sep-07 21:16
thestrat27-Sep-07 21:16 
AnswerRe: Smaller than a byte Pin
led mike27-Sep-07 10:06
led mike27-Sep-07 10:06 
AnswerRe: Smaller than a byte Pin
Chris Losinger27-Sep-07 10:48
professionalChris Losinger27-Sep-07 10:48 
GeneralRe: Smaller than a byte Pin
Waldermort27-Sep-07 10:59
Waldermort27-Sep-07 10:59 
Funny you say that, I was just playing around with the bitfields and found my solution. Though I'm not sure of how portable it may be.

struct block 
{
    union
    {
        struct Upper
        {
            BYTE Pack    : 4;
            BYTE State   : 3;
            BYTE Repaint : 1;
        };
        struct Lower
        {
            BYTE State   : 3;
            BYTE Repaint : 1;
        };
    
        BYTE Total;
    } U;
};




Waldermort

AnswerRe: Smaller than a byte Pin
Sameerkumar Namdeo27-Sep-07 17:42
Sameerkumar Namdeo27-Sep-07 17:42 
QuestionRe: Smaller than a byte Pin
zakkas248327-Sep-07 23:49
zakkas248327-Sep-07 23:49 
AnswerRe: Smaller than a byte Pin
Iain Clarke, Warrior Programmer28-Sep-07 5:31
Iain Clarke, Warrior Programmer28-Sep-07 5:31 
QuestionNeed a best possible alternative?? Pin
Kiran Satish27-Sep-07 7:08
Kiran Satish27-Sep-07 7:08 
AnswerRe: Need a best possible alternative?? Pin
Mark Salsbery27-Sep-07 7:31
Mark Salsbery27-Sep-07 7:31 
GeneralRe: Need a best possible alternative?? Pin
Kiran Satish1-Oct-07 10:41
Kiran Satish1-Oct-07 10:41 
QuestionRe: Need a best possible alternative?? Pin
Mark Salsbery1-Oct-07 11:15
Mark Salsbery1-Oct-07 11:15 
AnswerRe: Need a best possible alternative?? Pin
Kiran Satish1-Oct-07 11:34
Kiran Satish1-Oct-07 11:34 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery1-Oct-07 11:53
Mark Salsbery1-Oct-07 11:53 
GeneralRe: Need a best possible alternative?? [modified] Pin
Kiran Satish2-Oct-07 5:40
Kiran Satish2-Oct-07 5:40 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery2-Oct-07 5:48
Mark Salsbery2-Oct-07 5:48 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery2-Oct-07 6:34
Mark Salsbery2-Oct-07 6:34 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery2-Oct-07 7:01
Mark Salsbery2-Oct-07 7:01 
GeneralRe: Need a best possible alternative?? Pin
Kiran Satish2-Oct-07 7:42
Kiran Satish2-Oct-07 7:42 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery2-Oct-07 8:13
Mark Salsbery2-Oct-07 8:13 
GeneralRe: Need a best possible alternative?? Pin
Kiran Satish2-Oct-07 8:21
Kiran Satish2-Oct-07 8:21 
GeneralRe: Need a best possible alternative?? Pin
Mark Salsbery2-Oct-07 8:25
Mark Salsbery2-Oct-07 8:25 

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.