Click here to Skip to main content
15,921,295 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
David is correct, that's the way to do it, if you don't like his options, then you probably shouldn't have made it virtual, if its not virtual, then the call gets evaluated at runtime according to the pointer.

if not virtual...
CBase* cp = new CDerived();
cp->testApp();               //calls base testApp() because pointer is of type CBase
((CDerived *)cp)->testApp(); //calls derived testApp() because pointer is of type CDerived


..you just have to know exactly what it is you want.
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 
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 
GeneralRe: Showing a Confirmation Message Box on Closing a Dialog Pin
Code-o-mat3-May-11 22:40
Code-o-mat3-May-11 22:40 
GeneralRe: Showing a Confirmation Message Box on Closing a Dialog Pin
Richard MacCutchan4-May-11 1:46
mveRichard MacCutchan4-May-11 1:46 

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.