次の方法で共有


コンパイラ エラー C3766

'type' インターフェイス メソッド 'function' の実装を提供しなければなりません

インターフェイスから継承するクラスは、インターフェイス メンバーを実装する必要があります。

次の例では C3766 が生成されます。

// C3766.cpp
// compile with: /clr /c

delegate void MyDel();

interface struct IFace {
   virtual event MyDel ^ E;
};

ref struct Class1 : public IFace {};   // C3766

// OK
ref struct Class2 : public IFace {
   virtual event MyDel ^ E {
      void add(MyDel ^) {}
      void remove(MyDel ^) {}
   }
};