假设我有一个名为C#的接口IMyInterface定义如下:
// C# code
public interface IMyInterface
{
void Foo(string value);
string MyProperty { get; }
}
Run Code Online (Sandbox Code Playgroud)
假设我还有一个C++/CLI类MyConcreteClass,它实现了这个接口,其头部声明如下:
// C++/CLI header file
ref class MyConcreteClass : IMyInterface
{
public:
};
Run Code Online (Sandbox Code Playgroud)
如何在C++/CLI头中实现方法Foo和属性MyProperty?
我的尝试导致以下编译错误:
错误C3766:'MyConcreteClass'必须为接口方法提供一个实现'void IMyInterface :: Foo(System :: String ^ value)'
c++-cli ×1