Code:
public interface MyInterface
{
float InterfacePropertyOne { get; set; }
int InterfaceMethodOne();
string InterfaceMethodTwo();
}
Implementing properties in managed C++ is fairly similar to C#. Here's the new C++ implementation of the interface.
public ref class Class1 : public CSharpLib::MyInterface
{
public:
virtual int InterfaceMethodOne() { return 0; };
virtual System::String^ InterfaceMethodTwo() {return ""; };
virtual property float InterfacePropertyOne
{
void set(float value) { };
float get() { return 0; };
};
};
Here, however, implemented a C# interface in C++. But there should be no problem going the way candidates either. Whether this solves the problem if you define all the interfaces in C#
But as long as you add CLR support in C++ DLL there should be no problem going both ways.
Bookmarks