473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Inheriting from 2 Interfaces


Is it possible for a class to inherit from two interfaces?

When I try to add a second interface, and compile, the error is:
type in interface list is not an interface
related to the second interface.

If I remove the first interface, and compile with just the second, it
succeeds.

--
Texeme
http://texeme.com

incognito () Updated Almost Daily
http://kentpsychedelic.blogspot.com
Jul 21 '05 #1
2 1584
It is possible to inherit from (zero or one base class) + (zero to many
interfaces).

Therefore, if the second item in your interface list is a base class, it
won't compile.

Could this be the problem?

If not, could you post some code to demonstrate the problem?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"C.E.O. Gargantua" <us*@cord.blah> wrote in message
news:35*************@individual.net...

Is it possible for a class to inherit from two interfaces?

When I try to add a second interface, and compile, the error is:
type in interface list is not an interface
related to the second interface.

If I remove the first interface, and compile with just the second, it
succeeds.

--
Texeme
http://texeme.com

incognito () Updated Almost Daily
http://kentpsychedelic.blogspot.com

Jul 21 '05 #2

Ok, yes that was it.

I was using two interfaces.

I assigned each to one of two abstract classes.

Then I tried to derive a class from both class and the interfaces.

What I did is keep the two interfaces, and derive the abstract class
from them. Then I derive a set of classes from the one abstract class.

Thanks Nick!
Nick Malik [Microsoft] wrote:
It is possible to inherit from (zero or one base class) + (zero to many
interfaces).

Therefore, if the second item in your interface list is a base class, it
won't compile.

Could this be the problem?

If not, could you post some code to demonstrate the problem?

--
incognito...updated almost daily
http://kentpsychedelic.blogspot.com

Texeme Textcasting Technology
http://texeme.com

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tim Haughton | last post by:
Open question - is it possible to inherit comments along with an interface or class?? For example - I have a class that implements IXPathNavigable. When VS creates te method stub for me, it...
3
by: Mark | last post by:
I have a class which is implementing an interface, but I also want to have it inherit from a base class. Can you do both with a class? If so, what's the syntax? thanks.
2
by: C.E.O. Gargantua | last post by:
Is it possible for a class to inherit from two interfaces? When I try to add a second interface, and compile, the error is: type in interface list is not an interface related to the...
8
by: Anthony Williams | last post by:
Morning all, I'm having a wee problem with a project I'm working on at the moment. I'm leading my company into producing a website, based upon Web Standards, which will be created using XHTML...
2
by: Charles Law | last post by:
I want a set of controls that all have a border, like a group box. I thought I would create a base control containing just a group box from which my set of controls could inherit. Assuming that...
1
by: jbzdak | last post by:
Recently, I have been learning Java (it is one of laboratories on my department), well I know Java is awfully slow, but it is not the point that I'm interested. Java has a keyword "interface. (and...
4
by: Dan Holmes | last post by:
I am in a jam. Since C# (or the CLR) doesn't support MI i need to create either two inheritance hierarchies or have all my object inherit ultimately from MarshalByRefObject. I noticed that...
17
by: Adrian Hawryluk | last post by:
Hi all, What is everyone's opinion of const inheriting? Should the object that a pointer is pointing at inherit the constness of the pointer? Such as in the case of a class having a pointer...
1
by: adesoky | last post by:
I have a class that inherit from two interfaces, each interface has one method but the signatures of the two interfaces' methods are identical. How I can implement each method in the class...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.