Click here to Skip to main content
15,914,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Attach exe Pin
David Crow5-Jan-09 8:08
David Crow5-Jan-09 8:08 
QuestionModal dialog problem Pin
manoharbalu4-Jan-09 19:45
manoharbalu4-Jan-09 19:45 
AnswerRe: Modal dialog problem Pin
Chandrasekharan P4-Jan-09 21:14
Chandrasekharan P4-Jan-09 21:14 
GeneralRe: Modal dialog problem Pin
manoharbalu4-Jan-09 22:30
manoharbalu4-Jan-09 22:30 
GeneralRe: Modal dialog problem Pin
Chandrasekharan P4-Jan-09 23:34
Chandrasekharan P4-Jan-09 23:34 
GeneralRe: Modal dialog problem Pin
Code-o-mat5-Jan-09 0:49
Code-o-mat5-Jan-09 0:49 
AnswerRe: Modal dialog problem Pin
Nibu babu thomas4-Jan-09 21:55
Nibu babu thomas4-Jan-09 21:55 
QuestionStrange behavior in bit fields in "C++" Pin
Joseph Marzbani4-Jan-09 19:07
Joseph Marzbani4-Jan-09 19:07 
NOTE: I'm using an "Intel" machine to test the following codes.

I have an array of 48 Bytes named aArray and as you know it looks like some thing like this in memory:

100011011001110110110101 ...

Now, I want to separate six-bit chunks from the begin, useing bit fields as the follow:
struct CHUNKS
{
        unsigend  __int32    FirstChunk:6;
        unsigend  __int32    SecondChunk:6;
        unsigend  __int32    ThirdChunk:6;
        unsigend  __int32    FourthChunk:6;
}*pChunk = NULL;

for(int iCountor=0; iCountor<48; iCountor+=3)
{
        pChunk = (CHUNKS*) (aArray + iCountor);
        ...
}


What I expect is this:

Suppose aArray = 10001101 10011101 10110101 ...
and Say iCountor is equal to 0 at the moment.
pChunk->FirstChunk ... pChunk->FourthChunk should be as follow:

100011 011001 110110 110101

But that's not the case! pChunk->FirstChunk ... pChunk->FourthChunk are as follow:

pChunk->FirstChunk is equal to 001101 as follow:<br />
10<big>001101</big>  10011101  10110101<br />
<br />
pChunk->SecondChunk is equal to 110110 as follow:<br />
<big>10</big>001101  1001<big>1101</big>  10110101<br />
<br />
pChunk->ThirdChunk is equal to 011001 as follow:<br />
10001101  <big>1001</big>1101  101101<big>01</big><br />
<br />
pChunk->FourthChunk is equal to 101101 as follow:<br />
10001101  10011101  <big>101101</big>01


As you can see and I guess, no body can make anything of this situation.

Thank you masters!

AnswerRe: Strange behavior in bit fields in "C++" Pin
KarstenK4-Jan-09 21:00
mveKarstenK4-Jan-09 21:00 
AnswerRe: Strange behavior in bit fields in "C++" Pin
Sameerkumar Namdeo4-Jan-09 21:01
Sameerkumar Namdeo4-Jan-09 21:01 
AnswerRe: Strange behavior in bit fields in "C++" Pin
CPallini4-Jan-09 23:08
mveCPallini4-Jan-09 23:08 
AnswerRe: Strange behavior in bit fields in "C++" Pin
Stuart Dootson5-Jan-09 0:13
professionalStuart Dootson5-Jan-09 0:13 
Questionmemset? Pin
dec824-Jan-09 18:53
dec824-Jan-09 18:53 
AnswerRe: memset? Pin
dec824-Jan-09 19:18
dec824-Jan-09 19:18 
GeneralRe: memset? Pin
CPallini4-Jan-09 20:00
mveCPallini4-Jan-09 20:00 
AnswerRe: memset? Pin
ThatsAlok5-Jan-09 0:45
ThatsAlok5-Jan-09 0:45 
QuestionMy modal dialog loses focus to the parent dialog Pin
manoharbalu4-Jan-09 18:30
manoharbalu4-Jan-09 18:30 
AnswerRe: My modal dialog loses focus to the parent dialog Pin
David Crow5-Jan-09 8:10
David Crow5-Jan-09 8:10 
QuestionFile Exists Pin
rdop4-Jan-09 18:14
rdop4-Jan-09 18:14 
AnswerRe: File Exists Pin
Naveen4-Jan-09 18:20
Naveen4-Jan-09 18:20 
AnswerRe: File Exists Pin
Hamid_RT4-Jan-09 18:35
Hamid_RT4-Jan-09 18:35 
GeneralRe: File Exists Pin
KarstenK4-Jan-09 21:01
mveKarstenK4-Jan-09 21:01 
GeneralRe: File Exists Pin
Hamid_RT4-Jan-09 21:14
Hamid_RT4-Jan-09 21:14 
GeneralRe: File Exists Pin
ThatsAlok5-Jan-09 0:19
ThatsAlok5-Jan-09 0:19 
AnswerRe: File Exists Pin
Sameerkumar Namdeo4-Jan-09 21:04
Sameerkumar Namdeo4-Jan-09 21:04 

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.