Click here to Skip to main content
15,915,324 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: type casting function pointers Pin
toxcct16-Mar-06 4:07
toxcct16-Mar-06 4:07 
GeneralRe: type casting function pointers Pin
Martijn van Kleef16-Mar-06 5:02
Martijn van Kleef16-Mar-06 5:02 
GeneralRe: type casting function pointers Pin
Michael Dunn16-Mar-06 5:19
sitebuilderMichael Dunn16-Mar-06 5:19 
AnswerRe: type casting function pointers Pin
mzdude16-Mar-06 5:04
mzdude16-Mar-06 5:04 
GeneralRe: type casting function pointers Pin
toxcct16-Mar-06 5:13
toxcct16-Mar-06 5:13 
AnswerRe: type casting function pointers Pin
Dan McCormick16-Mar-06 5:21
Dan McCormick16-Mar-06 5:21 
GeneralRe: type casting function pointers Pin
Martijn van Kleef16-Mar-06 21:59
Martijn van Kleef16-Mar-06 21:59 
GeneralRe: type casting function pointers Pin
Dan McCormick17-Mar-06 1:34
Dan McCormick17-Mar-06 1:34 
Well, look at that - another syntax / semantics change from VC++ 6 to 2003/2005. Grumble, grumble, grumble... But yes, I just tried the variation you describe under 2005 and it does the trick.

Anyway, it's not that you are discarding a specific 'this' pointer. The issue is that you are not discarding the class association.

If you try to cast &CSomeClass::SomeMethod to something else such as:

DWORD dw = (DWORD) &CSomeClass::SomeMethod;

the compiler will still complain because this conversion would force it to discard the class association. (Actual error message under 2005 says,"There is no context in which this conversion is possible")

Dan

Remember kids, we're trained professionals.
Don't try this at home!

Questionhow to create a virtual serial port, and to monitor it Pin
szilics16-Mar-06 2:35
szilics16-Mar-06 2:35 
AnswerRe: how to create a virtual serial port, and to monitor it Pin
Chris Gao16-Mar-06 9:21
Chris Gao16-Mar-06 9:21 
QuestionPrinting without a printer Pin
Waldermort16-Mar-06 2:33
Waldermort16-Mar-06 2:33 
AnswerRe: Printing without a printer Pin
Jack Puppy16-Mar-06 2:49
Jack Puppy16-Mar-06 2:49 
GeneralRe: Printing without a printer Pin
Waldermort16-Mar-06 3:12
Waldermort16-Mar-06 3:12 
AnswerRe: Printing without a printer Pin
Ryan Binns16-Mar-06 17:24
Ryan Binns16-Mar-06 17:24 
QuestionCreateProcess Method Pin
Subramaniam s.V.16-Mar-06 2:04
Subramaniam s.V.16-Mar-06 2:04 
AnswerRe: CreateProcess Method Pin
Hamid_RT16-Mar-06 2:11
Hamid_RT16-Mar-06 2:11 
GeneralRe: CreateProcess Method Pin
SilentSilent16-Mar-06 3:16
SilentSilent16-Mar-06 3:16 
AnswerRe: CreateProcess Method Pin
Michael Dunn16-Mar-06 5:15
sitebuilderMichael Dunn16-Mar-06 5:15 
AnswerRe: CreateProcess Method Pin
Chris Gao16-Mar-06 9:26
Chris Gao16-Mar-06 9:26 
AnswerRe: CreateProcess Method Pin
Stephen Hewitt16-Mar-06 12:04
Stephen Hewitt16-Mar-06 12:04 
GeneralRe: CreateProcess Method Pin
Chris Gao16-Mar-06 15:34
Chris Gao16-Mar-06 15:34 
GeneralRe: CreateProcess Method Pin
Subramaniam s.V.16-Mar-06 17:35
Subramaniam s.V.16-Mar-06 17:35 
GeneralRe: CreateProcess Method Pin
Subramaniam s.V.16-Mar-06 17:48
Subramaniam s.V.16-Mar-06 17:48 
Questionfaster method of bitmap reading Pin
_tasleem16-Mar-06 1:22
_tasleem16-Mar-06 1:22 
AnswerRe: faster method of bitmap reading Pin
Remco Hoogenboezem16-Mar-06 4:03
Remco Hoogenboezem16-Mar-06 4:03 

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.