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

C / C++ / MFC

 
GeneralRe: Thanks Pin
Tim Smith27-Dec-01 15:18
Tim Smith27-Dec-01 15:18 
GeneralRe: Win XP Pin
Alvaro Mendez27-Dec-01 10:10
Alvaro Mendez27-Dec-01 10:10 
GeneralRe: Win XP Pin
Ravi Bhavnani27-Dec-01 10:43
professionalRavi Bhavnani27-Dec-01 10:43 
GeneralRe: Win XP Pin
Alvaro Mendez27-Dec-01 11:30
Alvaro Mendez27-Dec-01 11:30 
GeneralBeta 2 Or Release Candidate Pin
vinuk27-Dec-01 6:31
vinuk27-Dec-01 6:31 
GeneralRe: Beta 2 Or Release Candidate Pin
Christian Graus27-Dec-01 14:54
protectorChristian Graus27-Dec-01 14:54 
GeneralBitwise operators, static cast and Position pointers Pin
27-Dec-01 6:26
suss27-Dec-01 6:26 
GeneralRe: Bitwise operators, static cast and Position pointers Pin
Michael Dunn27-Dec-01 7:10
sitebuilderMichael Dunn27-Dec-01 7:10 
I still don't get what you're trying to do. Your casts are wrong, and you're assuming a POSITION is a pointer to one of the list elements. Don't make any assumptions about opaque data types like that (or HWNDs or any handles for that matter).

Oh wait, you just want to pick out the individual bytes of the pointer address? Use the bitwise operators, that's what they're there for:
BYTE a,b,c,d;
void* p = 0x1234abcd;
 
  a = ( p & 0xFF000000 ) >> 24;  // high byte
  b = ( p & 0xFF0000 ) >> 16;    // 2nd highest byte
  c = ( p & 0xFF00 ) >> 8;       // 3rd highest byte
  d = ( p & 0xFF );              // low byte
And just FYI, if you want the value of a pointer, just do this:
printf ( "%p", p );


--Mike--
My really out-of-date homepage
Buffy's on. Gotta go, bye!
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
GeneralRe: Bitwise operators, static cast and Position pointers Pin
27-Dec-01 7:40
suss27-Dec-01 7:40 
GeneralRe: Bitwise operators, static cast and Position pointers Pin
Tim Smith27-Dec-01 7:46
Tim Smith27-Dec-01 7:46 
GeneralRe: Bitwise operators, static cast and Position pointers Pin
27-Dec-01 12:19
suss27-Dec-01 12:19 
GeneralRAS...I don't get him! Pin
BlackSmith27-Dec-01 6:02
BlackSmith27-Dec-01 6:02 
GeneralRe: RAS...I don't get him! Pin
Masaaki Onishi27-Dec-01 7:02
Masaaki Onishi27-Dec-01 7:02 
GeneralRe: RAS...I don't get him! Pin
Joel Lucsy27-Dec-01 8:43
Joel Lucsy27-Dec-01 8:43 
GeneralRe: RAS...I don't get him! Pin
Rickard Andersson2027-Dec-01 8:57
Rickard Andersson2027-Dec-01 8:57 
GeneralIssues opening files Pin
Stew27-Dec-01 5:51
Stew27-Dec-01 5:51 
GeneralRe: Issues opening files Pin
Chris Meech27-Dec-01 9:29
Chris Meech27-Dec-01 9:29 
GeneralRe: Issues opening files Pin
Stew28-Dec-01 4:45
Stew28-Dec-01 4:45 
GeneralTurning on/off caps lock, num lock and scroll lock Pin
Nnamdi Onyeyiri27-Dec-01 5:34
Nnamdi Onyeyiri27-Dec-01 5:34 
GeneralRe: Turning on/off caps lock, num lock and scroll lock Pin
Chris Meech27-Dec-01 9:34
Chris Meech27-Dec-01 9:34 
GeneralRe: Turning on/off caps lock, num lock and scroll lock Pin
567890123430-Dec-01 1:46
567890123430-Dec-01 1:46 
QuestionModems-Connected or Not? Pin
BlackSmith27-Dec-01 1:46
BlackSmith27-Dec-01 1:46 
AnswerRe: Modems-Connected or Not? Pin
Nish Nishant27-Dec-01 1:58
sitebuilderNish Nishant27-Dec-01 1:58 
GeneralFile size in FTP server... Pin
27-Dec-01 1:22
suss27-Dec-01 1:22 
GeneralBeeep! Pin
Rickard Andersson2027-Dec-01 1:19
Rickard Andersson2027-Dec-01 1: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.