Click here to Skip to main content
15,919,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWINVER related question Pin
Maarten Kools14-Apr-04 9:47
professionalMaarten Kools14-Apr-04 9:47 
GeneralRe: WINVER related question Pin
Joe Woodbury14-Apr-04 10:29
professionalJoe Woodbury14-Apr-04 10:29 
GeneralRe: WINVER related question Pin
Maarten Kools14-Apr-04 10:31
professionalMaarten Kools14-Apr-04 10:31 
GeneralRe: WINVER related question Pin
Joe Woodbury14-Apr-04 13:10
professionalJoe Woodbury14-Apr-04 13:10 
GeneralRe: WINVER related question Pin
Maarten Kools14-Apr-04 13:40
professionalMaarten Kools14-Apr-04 13:40 
Generalreinterpret_cast question Pin
ursus zeta14-Apr-04 9:32
ursus zeta14-Apr-04 9:32 
GeneralRe: reinterpret_cast question Pin
Maarten Kools14-Apr-04 9:40
professionalMaarten Kools14-Apr-04 9:40 
GeneralRe: reinterpret_cast question Pin
ursus zeta14-Apr-04 9:54
ursus zeta14-Apr-04 9:54 
Thanks for the response. I should have been clearer in my initial question.
The code that Feng Yuan uses works perfectly, but appears cumbersome and even though the compiler will accept the cast, it does no checking of types to insure adequate memory addressing (...but, I'm probably wrong about this). In this case, Feng Yuan casts from a BYTE pointer to a BITMAPINFO pointer (they obviously are the same size or the function would not work). I have not tried this, but, I'm guessing that you could use the same technique with a VOID* (VOID pointer).
More importantly, why even use reinterpret_cast at all? Why does Microsoft even include it in it's Programmer API? This whole subject is a mystery to me. I'm curious as to what instructions the compiler actually issues when such a cast is made.
Also, an assert statement could be made, but Feng Yuan never does. No doubt I'm missing something important here.
This further information from MSDN:
There are several casting operators specific to the C++ language. These operators are intended to remove some of the ambiguity and danger inherent in old style C language casts. These operators are:
dynamic_cast Used for conversion of polymorphic types.
static_cast Used for conversion of nonpolymorphic types.
const_cast Used to remove the const, volatile, and __unaligned attributes.
reinterpret_cast Used for simple reinterpretation of bits.

GeneralRe: reinterpret_cast question Pin
Maarten Kools14-Apr-04 10:15
professionalMaarten Kools14-Apr-04 10:15 
GeneralRe: reinterpret_cast question Pin
Gary R. Wheeler14-Apr-04 13:38
Gary R. Wheeler14-Apr-04 13:38 
GeneralRe: reinterpret_cast question Pin
Paul Ranson14-Apr-04 11:08
Paul Ranson14-Apr-04 11:08 
GeneralThanks for info Pin
ursus zeta14-Apr-04 12:39
ursus zeta14-Apr-04 12:39 
QuestionHow do I display image data? Pin
Member 15847214-Apr-04 9:22
Member 15847214-Apr-04 9:22 
AnswerRe: How do I display image data? Pin
Mike Dimmick14-Apr-04 9:30
Mike Dimmick14-Apr-04 9:30 
GeneralRe: How do I display image data? Pin
Member 15847214-Apr-04 11:17
Member 15847214-Apr-04 11:17 
GeneralDocument/View question Pin
stelitsisan14-Apr-04 8:46
stelitsisan14-Apr-04 8:46 
GeneralLinker error only in release mode Pin
doctorpi14-Apr-04 8:38
doctorpi14-Apr-04 8:38 
GeneralRe: Linker error only in release mode Pin
doctorpi14-Apr-04 8:47
doctorpi14-Apr-04 8:47 
GeneralRe: Linker error only in release mode Pin
Mike Dimmick14-Apr-04 9:32
Mike Dimmick14-Apr-04 9:32 
GeneralDAO Debug and Release Pin
Rome Singh14-Apr-04 8:18
Rome Singh14-Apr-04 8:18 
GeneralDependency Walker Pin
pcdev14-Apr-04 8:04
pcdev14-Apr-04 8:04 
GeneralRe: Dependency Walker Pin
Mike Dimmick14-Apr-04 9:43
Mike Dimmick14-Apr-04 9:43 
GeneralHaving problems with this code need direction Pin
jss67200114-Apr-04 8:02
jss67200114-Apr-04 8:02 
GeneralArray of objects Pin
Anonymous14-Apr-04 7:49
Anonymous14-Apr-04 7:49 
GeneralRe: Array of objects Pin
John M. Drescher14-Apr-04 7:56
John M. Drescher14-Apr-04 7:56 

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.