![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
Is it legal to derive from a class that inherits multiple classes?I am having trouble to create a MFC class that is a subclass of a class with multiple inheritance. I am wondering if MFC supports this? Here is the scenario:
Class A derives from CObject Class B derives from CDialog Class C derives from B and A (so far so good, Class C works fine) Class D derives from C (In runtime, I got following message when OK button on object of class D is clicked) Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one ... BTW, each derived class has DECLARE_DYNAMIC macro in header file |
|||
|
#2
|
|||
|
|||
Re: Is it legal to derive from a class that inherits multiple classes?Let me answer the question myself.
Yes, I have run a test and proved it is ok to derive from a class that inherits multiple classes. |
|
#3
|
||||
|
||||
Re: Is it legal to derive from a class that inherits multiple classes?So what caused the error with ESP? I didn't want to respond without also knowing what might have been causing the problem.
__________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#4
|
|||
|
|||
Re: Is it legal to derive from a class that inherits multiple classes?Error was caused by wrong type of argument. It has nothing to do with inheritance.
|
|
#5
|
|||
|
|||
Re: Is it legal to derive from a class that inherits multiple classes?CObject CDialog
| | A B \ / C | D class A & B : public virtual CObject & CDialog. I hope this help. |
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Classes and allocating memory | BlueFireCO. | C++ Forum | 13 | 26-Jul-2007 20:31 |
| Hard drive/CPU Diagnoses Issues | binarybug | Computer Hardware Forum | 1 | 22-Jan-2007 19:23 |
| Message Class | TransformedBG | C++ Forum | 5 | 29-Nov-2006 21:28 |
| Box Class, need help again :( | TransformedBG | C++ Forum | 7 | 13-Nov-2006 15:11 |
| a tester class and then some. | postage | Java Forum | 1 | 06-May-2006 15:48 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The