Click here to Skip to main content
15,924,036 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Due to bit alignment in bytes, I think you cannot avoid a bit of bitwise manipulation. Roll eyes | :rolleyes:

For instance
#include <iostream>
#include <iomanip>
using namespace std;


// 10001101 10011101 10110101
// 11111110 11011100 10111010

void main()
{
  unsigned char aArray[]={0x8D, 0x9D, 0xB5, 0xFE, 0xDC, 0xBA};

  unsigned char bChunk[4];

  cout << setbase(16);
  for(int iIndex=0; iIndex<6; iIndex+=3)
  {
    bChunk[0] = aArray[iIndex] >> 2;
    bChunk[1] = (aArray[iIndex] << 4)  & 0x3F | aArray[iIndex+1] >> 4;
    bChunk[2] = (aArray[iIndex+1] << 2 ) & 0x3F | aArray[iIndex+2] >> 6;
    bChunk[3] = aArray[iIndex+2] & 0x3F;
    cout << (int)bChunk[0] << " " << (int)bChunk[1] << " " << (int)bChunk[2] << " " << (int)bChunk[3] << endl;
  }
}


Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

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 
GeneralRe: File Exists Pin
ThatsAlok5-Jan-09 0:20
ThatsAlok5-Jan-09 0:20 
QuestionHow to create a custom list control in MFC ? Pin
shah1864-Jan-09 18:08
shah1864-Jan-09 18:08 
AnswerRe: How to create a custom list control in MFC ? Pin
Hamid_RT4-Jan-09 18:36
Hamid_RT4-Jan-09 18:36 

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.