UnfitElf
September 16th, 2006, 11:21 PM
Hi everyone.
I have a base class which has a pure virtual function called Draw. From this base class i derive several other classes. From from one of these derived classes i derive another class.
Base Class
|
/ \
/ \
Class A Class B
\
Class C
What i would like to be able to do is call Class B's Draw function from Class C's Draw function. This is becuase class c needs to draw exactly what class b draws, but it needs to add a bit more to the drawing as well.
So it would be something like this:
//...
void ClassC::Draw (HDC hdc)
{
// Call Class B's Draw function
//
// Add the extra drawing required for class c
Rectangle(....);
}
Is this possible?
Many Thanks
I have a base class which has a pure virtual function called Draw. From this base class i derive several other classes. From from one of these derived classes i derive another class.
Base Class
|
/ \
/ \
Class A Class B
\
Class C
What i would like to be able to do is call Class B's Draw function from Class C's Draw function. This is becuase class c needs to draw exactly what class b draws, but it needs to add a bit more to the drawing as well.
So it would be something like this:
//...
void ClassC::Draw (HDC hdc)
{
// Call Class B's Draw function
//
// Add the extra drawing required for class c
Rectangle(....);
}
Is this possible?
Many Thanks