By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,804 Members | 1,681 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,804 IT Pros & Developers. It's quick & easy.

Multiple Inheritance in VC++6.0

P: n/a
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! :(
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Marcos E. Kurbán" <mk*****@cs.utwente.nl> wrote in message
news:d2**********@ares.cs.utwente.nl...
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
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.