Using C++.net interface 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? SDX2000SDX2000
-
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? SDX2000SDX2000
Don't you want a managed C++ interface class instead?
public interface class IAnimal {...
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Don't you want a managed C++ interface class instead?
public interface class IAnimal {...
Mark Salsbery Microsoft MVP - Visual C++ :java:
Thanks for pointing this out. I have used C++ and C# but I am new to C++/CLI. This works as desired.
SDX2000