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

C / C++ / MFC

 
GeneralRe: copying one array into another -simple question Pin
Ravi Bhavnani4-Aug-02 14:53
professionalRavi Bhavnani4-Aug-02 14:53 
GeneralRe: copying one array into another -simple question Pin
Daniel Lohmann5-Aug-02 3:56
Daniel Lohmann5-Aug-02 3:56 
GeneralOO design question Pin
David Wulff4-Aug-02 12:55
David Wulff4-Aug-02 12:55 
GeneralRe: OO design question Pin
Ravi Bhavnani4-Aug-02 15:00
professionalRavi Bhavnani4-Aug-02 15:00 
GeneralRe: OO design question Pin
David Wulff4-Aug-02 15:32
David Wulff4-Aug-02 15:32 
GeneralRe: OO design question Pin
Shog94-Aug-02 19:45
sitebuilderShog94-Aug-02 19:45 
GeneralRe: OO design question Pin
David Wulff5-Aug-02 1:33
David Wulff5-Aug-02 1:33 
GeneralRe: OO design question Pin
Shog95-Aug-02 5:14
sitebuilderShog95-Aug-02 5:14 
David Wulff wrote:
A thought has just struck me...

Ok, now you're *really* getting overly complex.

I wish i could remember, i just read a nice little technique for handling situations such as this... might even have been on CP. Can't recall Frown | :(

But anyway, the gist of it is this:

  • In the base class, have two methods. One, DoFrameStuff() is not virtual, and implements the code you want shared between all derived classes. The other, Frame() is virtual, and just calls DoFrameStuff() (if you won't be instantiating (sp?) the base class, then just make it pure virtual).
  • In each derived class, implement a new version of DoFrameStuff() that does only what the derived class adds, and doesn't call the base class method. Also implement Frame() as calling only DoFrameStuff() and BaseClass::DoFrameStuff().
  • In the grandchild class, implement Frame() as calling Child1::DoFrameStuff() Child2::DoFrameStuff() and BaseClass::DoFrameStuff() in order.

In this way, you have absolute control over the order in which the methods are called at each point. I admit, your system may be a bit more complex than this (my description assumes fairly simple interdependancies between each of the methods), but working from this basic structure it shouldn't be too difficult.

---

Shog9
If I could sleep forever, I could forget about everything...

GeneralRe: OO design question Pin
David Wulff5-Aug-02 6:46
David Wulff5-Aug-02 6:46 
GeneralRe: OO design question Pin
Stan Shannon5-Aug-02 8:47
Stan Shannon5-Aug-02 8:47 
GeneralRe: OO design question Pin
Stan Shannon5-Aug-02 2:04
Stan Shannon5-Aug-02 2:04 
GeneralRe: OO design question Pin
David Wulff5-Aug-02 2:29
David Wulff5-Aug-02 2:29 
GeneralRe: OO design question Pin
Stan Shannon5-Aug-02 3:43
Stan Shannon5-Aug-02 3:43 
GeneralRe: OO design question Pin
Ravi Bhavnani5-Aug-02 3:37
professionalRavi Bhavnani5-Aug-02 3:37 
GeneralRe: OO design question Pin
Tomasz Sowinski4-Aug-02 23:51
Tomasz Sowinski4-Aug-02 23:51 
GeneralRe: OO design question Pin
David Wulff5-Aug-02 1:22
David Wulff5-Aug-02 1:22 
Generalusing CBitmapButton Pin
Mavrock4-Aug-02 11:58
Mavrock4-Aug-02 11:58 
GeneralRe: using CBitmapButton Pin
Ravi Bhavnani4-Aug-02 15:00
professionalRavi Bhavnani4-Aug-02 15:00 
GeneralGetting selected text globally Pin
Christian Skovdal Andersen4-Aug-02 11:19
Christian Skovdal Andersen4-Aug-02 11:19 
GeneralRe: Getting selected text globally Pin
Tomasz Sowinski5-Aug-02 0:07
Tomasz Sowinski5-Aug-02 0:07 
GeneralRe: Getting selected text globally Pin
Gene Yu14-Jan-03 8:56
Gene Yu14-Jan-03 8:56 
GeneralDefault font set for window's dialogs Pin
CaesarCZ4-Aug-02 10:28
CaesarCZ4-Aug-02 10:28 
GeneralRe: Default font set for window's dialogs Pin
pépé5-Aug-02 2:18
pépé5-Aug-02 2:18 
GeneralScrollbar size Pin
CaesarCZ4-Aug-02 10:22
CaesarCZ4-Aug-02 10:22 
GeneralRe: Scrollbar size Pin
PJ Arends4-Aug-02 12:40
professionalPJ Arends4-Aug-02 12:40 

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.