Multiple Inheritance in VC++6.0

  • Thread starter =?ISO-8859-15?Q?=22Marcos_E=2E_Kurb=E1n=22?=
  • Start date
?

=?ISO-8859-15?Q?=22Marcos_E=2E_Kurb=E1n=22?=

Hi all,
To begin with: yes I know VC6 is way too old to be used today, but it's
what I have :)
I have this inheritance problem:

class A {
virtual const wchar_t *f() const = 0;
}

class B {
virtual const wchar_t *g() const = 0;
}

class AA : public A {
virutal const wchar_t *f() const ;
/* I tried with and without the 'virtual' qualifier here */
}

class BB : public AA, public B {
const wchar_t *g() const;
}

AA a; // OK for VC6
BB b; // it says wrong: "f not implemented"!

IS THIS COMPLIANT?
Am I missing something stupid? (some keyword, clause or something?)
Thanks for any help!
Regards,

Marcos

PS: I also tried the following in BB:
using AA:f;
won't work either! :(
 
D

David White

Marcos E. Kurbán said:
Hi all,
To begin with: yes I know VC6 is way too old to be used today, but it's
what I have :)
I have this inheritance problem:

class A {
virtual const wchar_t *f() const = 0;
}

class B {
virtual const wchar_t *g() const = 0;
}

class AA : public A {
virutal const wchar_t *f() const ;
/* I tried with and without the 'virtual' qualifier here */
}

class BB : public AA, public B {
const wchar_t *g() const;
}

AA a; // OK for VC6
BB b; // it says wrong: "f not implemented"!

IS THIS COMPLIANT?

It's your code that's not compliant, not the compiler.
Am I missing something stupid? (some keyword, clause or something?)

Yes, semicolons and a misspelling.

This works in VC++ 6.0 (SP5 or SP6, I forget which):

class A {
virtual const wchar_t *f() const = 0;
};

class B {
virtual const wchar_t *g() const = 0;
};

class AA : public A {
virtual const wchar_t *f() const ;
};

class BB : public AA, public B {
const wchar_t *g() const;
};

AA a;
BB b;

DW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,663
Latest member
josh5959

Latest Threads

Top