Click here to Skip to main content
15,904,828 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Function Pointer Pin
dehseth2-Mar-09 8:14
dehseth2-Mar-09 8:14 
GeneralRe: Function Pointer Pin
Stuart Dootson2-Mar-09 8:17
professionalStuart Dootson2-Mar-09 8:17 
QuestionRe: Function Pointer Pin
CPallini2-Mar-09 10:17
mveCPallini2-Mar-09 10:17 
GeneralRe: Function Pointer Pin
Richard Andrew x642-Mar-09 9:38
professionalRichard Andrew x642-Mar-09 9:38 
GeneralRe: Function Pointer [modified] Pin
Stuart Dootson2-Mar-09 10:02
professionalStuart Dootson2-Mar-09 10:02 
GeneralRe: Function Pointer Pin
Rajesh R Subramanian2-Mar-09 19:59
professionalRajesh R Subramanian2-Mar-09 19:59 
AnswerRe: Function Pointer Pin
Perisic, Aleksandar2-Mar-09 8:45
Perisic, Aleksandar2-Mar-09 8:45 
GeneralRe: Function Pointer Pin
Perisic, Aleksandar2-Mar-09 9:08
Perisic, Aleksandar2-Mar-09 9:08 
The reason this is so is that method does not know anything about the instance that calls it. The instance pointer (this) is resolved at the moment of method call. This:

C c;<br />
c.method();


is executed using always one and the same address of the method but the class instance pointer ( this-> ) is passed for example as the first hidden parameter (which is hidden from us) like this

method(&c)

or the instance pointer (&c) is moved into ECX register first and then method() is called where each this-> is then referred by the content of ECX.

You can't avoid this problem even with boost or any other library.
AnswerRe: Function Pointer [modified] Pin
Perisic, Aleksandar2-Mar-09 11:48
Perisic, Aleksandar2-Mar-09 11:48 
Question[Message Deleted] Pin
Davitor2-Mar-09 5:58
Davitor2-Mar-09 5:58 
AnswerRe: File handaling problem Pin
Richard Andrew x642-Mar-09 6:12
professionalRichard Andrew x642-Mar-09 6:12 
GeneralRe: File handaling problem Pin
Ric Ashton2-Mar-09 6:31
Ric Ashton2-Mar-09 6:31 
GeneralRe: File handaling problem Pin
Ric Ashton2-Mar-09 6:33
Ric Ashton2-Mar-09 6:33 
GeneralRe: File handaling problem Pin
Davitor2-Mar-09 6:45
Davitor2-Mar-09 6:45 
GeneralRe: File handaling problem Pin
Davitor2-Mar-09 6:42
Davitor2-Mar-09 6:42 
GeneralRe: File handaling problem Pin
Eytukan2-Mar-09 6:56
Eytukan2-Mar-09 6:56 
GeneralRe: File handaling problem Pin
Ric Ashton2-Mar-09 6:59
Ric Ashton2-Mar-09 6:59 
GeneralRe: File handaling problem Pin
Richard Andrew x642-Mar-09 7:44
professionalRichard Andrew x642-Mar-09 7:44 
AnswerRe: File handaling problem Pin
Maximilien2-Mar-09 6:53
Maximilien2-Mar-09 6:53 
GeneralRe: File handaling problem Pin
Davitor2-Mar-09 7:05
Davitor2-Mar-09 7:05 
GeneralRe: File handaling problem Pin
Maximilien2-Mar-09 7:16
Maximilien2-Mar-09 7:16 
AnswerRe: File handaling problem Pin
David Crow2-Mar-09 9:01
David Crow2-Mar-09 9:01 
QuestionConstructor / Destructor Question Pin
Richard Andrew x642-Mar-09 5:15
professionalRichard Andrew x642-Mar-09 5:15 
AnswerRe: Constructor / Destructor Question Pin
«_Superman_»2-Mar-09 5:31
professional«_Superman_»2-Mar-09 5:31 
GeneralRe: Constructor / Destructor Question Pin
Richard Andrew x642-Mar-09 6:10
professionalRichard Andrew x642-Mar-09 6:10 

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.