Using C++.net Interfaces in C#
-
Hi, Please consider the following interface in C++.Net
public __interface IAnimal { void Eat(String^ food); };
when I try to implement this in a C# class...class Dog : IAnimal { ... }
It gives me an error "error CS0509: 'Dog': cannot derive from sealed type 'IAnimal'" What am I doing wrong here?SDX2000
-
Hi, Please consider the following interface in C++.Net
public __interface IAnimal { void Eat(String^ food); };
when I try to implement this in a C# class...class Dog : IAnimal { ... }
It gives me an error "error CS0509: 'Dog': cannot derive from sealed type 'IAnimal'" What am I doing wrong here?SDX2000
Your definition of the IAnimal interface is incorrect. Try:
public interface class IAnimal {
void Eat(String^ food);
};Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com
-
Your definition of the IAnimal interface is incorrect. Try:
public interface class IAnimal {
void Eat(String^ food);
};Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com
Thanks Tom.
The best way to accelerate a Macintosh is at 9.8m/sec-sec. - Marcus Dolengo