Click here to Skip to main content
15,890,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionupcast Pin
Smith#4-May-11 4:25
Smith#4-May-11 4:25 
GeneralRe: upcast Pin
David Crow4-May-11 5:07
David Crow4-May-11 5:07 
GeneralRe: upcast Pin
Albert Holguin4-May-11 5:15
professionalAlbert Holguin4-May-11 5:15 
AnswerRe: upcast Pin
Albert Holguin4-May-11 5:19
professionalAlbert Holguin4-May-11 5:19 
GeneralRe: upcast Pin
Smith#4-May-11 5:30
Smith#4-May-11 5:30 
GeneralRe: upcast Pin
Albert Holguin4-May-11 5:34
professionalAlbert Holguin4-May-11 5:34 
GeneralRe: upcast Pin
Albert Holguin4-May-11 5:37
professionalAlbert Holguin4-May-11 5:37 
GeneralRe: upcast Pin
Stefan_Lang4-May-11 6:26
Stefan_Lang4-May-11 6:26 
See my answer below: you can still call methods from the base class(es) even if the pointer you use to call it points to a class that has overridden that implementation:
CBase* pbase = new CBase;
CDerived* pDerived = new CDerived;
pbase->testApp(); // "I'm Base"
pDerived->testApp(); // I'm Derived"
pDerived->CBase::testApp(); // "I'm Base"

You can invoke methods of base classes by adding the name of that class, separated by '::' to the name of the function you want to call. In doing so you ignore the virtual function table for that call only. You can freely mix calls of that type with normal calls that use the virtual functions, as you can see in the example above.
AnswerRe: upcast Pin
Stefan_Lang4-May-11 5:29
Stefan_Lang4-May-11 5:29 
GeneralRe: upcast Pin
Smith#4-May-11 6:03
Smith#4-May-11 6:03 
GeneralRe: upcast Pin
Albert Holguin4-May-11 7:15
professionalAlbert Holguin4-May-11 7:15 
QuestionDebug OK, Release wrong after run 59times Pin
bopi4-May-11 4:17
bopi4-May-11 4:17 
QuestionRe: Debug OK, Release wrong after run 59times Pin
David Crow4-May-11 5:12
David Crow4-May-11 5:12 
GeneralRe: Debug OK, Release wrong after run 59times Pin
Albert Holguin4-May-11 5:22
professionalAlbert Holguin4-May-11 5:22 
AnswerRe: Debug OK, Release wrong after run 59times Pin
Stefan_Lang4-May-11 5:40
Stefan_Lang4-May-11 5:40 
QuestionWhy Enter key in Editbox count as 2 Character? Pin
Le@rner4-May-11 2:07
Le@rner4-May-11 2:07 
AnswerRe: Why Enter key in Editbox count as 2 Character? Pin
Niklas L4-May-11 2:11
Niklas L4-May-11 2:11 
GeneralRe: Why Enter key in Editbox count as 2 Character? Pin
Le@rner4-May-11 2:13
Le@rner4-May-11 2:13 
GeneralRe: Why Enter key in Editbox count as 2 Character? Pin
Niklas L4-May-11 2:17
Niklas L4-May-11 2:17 
GeneralRe: Why Enter key in Editbox count as 2 Character? Pin
Le@rner4-May-11 2:26
Le@rner4-May-11 2:26 
GeneralRe: Why Enter key in Editbox count as 2 Character? Pin
Niklas L4-May-11 2:30
Niklas L4-May-11 2:30 
QuestionShowing a Confirmation Message Box on Closing a Dialog Pin
pix_programmer3-May-11 21:26
pix_programmer3-May-11 21:26 
AnswerRe: Showing a Confirmation Message Box on Closing a Dialog Pin
Richard MacCutchan3-May-11 21:55
mveRichard MacCutchan3-May-11 21:55 
AnswerRe: Showing a Confirmation Message Box on Closing a Dialog Pin
Code-o-mat3-May-11 21:57
Code-o-mat3-May-11 21:57 
GeneralRe: Showing a Confirmation Message Box on Closing a Dialog Pin
pix_programmer3-May-11 22:28
pix_programmer3-May-11 22:28 

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.