Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pls help.....! Pin
ThatsAlok26-Sep-07 19:38
ThatsAlok26-Sep-07 19:38 
GeneralRe: pls help.....! Pin
David Crow26-Sep-07 2:48
David Crow26-Sep-07 2:48 
QuestionVirtual methods Pin
Waldermort25-Sep-07 23:16
Waldermort25-Sep-07 23:16 
AnswerRe: Virtual methods Pin
Russell'25-Sep-07 23:51
Russell'25-Sep-07 23:51 
AnswerRe: Virtual methods Pin
Cedric Moonen26-Sep-07 1:01
Cedric Moonen26-Sep-07 1:01 
GeneralRe: Virtual methods Pin
toxcct26-Sep-07 1:09
toxcct26-Sep-07 1:09 
GeneralRe: Virtual methods Pin
Waldermort26-Sep-07 3:47
Waldermort26-Sep-07 3:47 
GeneralRe: Virtual methods Pin
Roger Stoltz26-Sep-07 5:06
Roger Stoltz26-Sep-07 5:06 
Perhaps this could be a design issue...

Basic OO design gives that a child class is a specialization of the base class and inherits the behavior of the base class. It's like saying "a rectangle is a shape" and shape would be the base class of rectangle. I guess you already know this.
But the implication is that when you derive from a class you also derive its behavior, i.e. the implementation of a certain method in case it's declared as virtual.
Calling a base class implementation of a method is quite alright, it just means that you want the behavior of the base class and want to add a little something to it.
From my understanding you want to go the other way around, i.e. calling the child class implementation from the base class and this creates some problems. Not that they cannot be solved, but there's a possibility that you're trying to solve the problem using the wrong tool.

Perhaps it's the observer design pattern[^] you really need. It's the same pattern used in the doc/view architecture when the document notifies all views about a change in the document.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

GeneralRe: Virtual methods Pin
Waldermort26-Sep-07 5:19
Waldermort26-Sep-07 5:19 
GeneralRe: Virtual methods Pin
Roger Stoltz26-Sep-07 5:29
Roger Stoltz26-Sep-07 5:29 
GeneralRe: Virtual methods Pin
Waldermort26-Sep-07 5:37
Waldermort26-Sep-07 5:37 
GeneralRe: Virtual methods Pin
Waldermort26-Sep-07 6:28
Waldermort26-Sep-07 6:28 
GeneralRe: Virtual methods Pin
Roger Stoltz26-Sep-07 8:58
Roger Stoltz26-Sep-07 8:58 
GeneralRe: Virtual methods Pin
Waldermort27-Sep-07 5:49
Waldermort27-Sep-07 5:49 
QuestionDrawing a rectangle Pin
Maynka25-Sep-07 23:12
Maynka25-Sep-07 23:12 
AnswerRe: Drawing a rectangle Pin
Hamid_RT25-Sep-07 23:29
Hamid_RT25-Sep-07 23:29 
AnswerRe: Drawing a rectangle Pin
Russell'25-Sep-07 23:55
Russell'25-Sep-07 23:55 
Questionsize of char * Pin
baerten25-Sep-07 22:42
baerten25-Sep-07 22:42 
AnswerRe: size of char * Pin
Naveen25-Sep-07 22:52
Naveen25-Sep-07 22:52 
AnswerRe: size of char * Pin
Cedric Moonen25-Sep-07 22:59
Cedric Moonen25-Sep-07 22:59 
AnswerRe: size of char * Pin
Waldermort25-Sep-07 23:08
Waldermort25-Sep-07 23:08 
QuestionRe: size of char * Pin
David Crow26-Sep-07 2:51
David Crow26-Sep-07 2:51 
AnswerRe: size of char * Pin
Nemanja Trifunovic26-Sep-07 3:37
Nemanja Trifunovic26-Sep-07 3:37 
AnswerRe: size of char * Pin
Signal-926-Sep-07 14:53
Signal-926-Sep-07 14:53 
Questionabout display of line symbol Pin
yidingyu25-Sep-07 22:26
yidingyu25-Sep-07 22:26 

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.