共用方式為


編譯器錯誤 C3911

'event_accessor_method': 函式必須具有 'signature' 類型

未正確宣告事件的存取子方法。

如需詳細資訊,請參閱 事件

下列範例會產生 C3911:

// C3911.cpp
// compile with: /clr
using namespace System;
delegate void H(String^, int);

ref class X {
   event H^ E1 {
      void add() {}   // C3911
      // try the following line instead
      // void add(H ^ h) {}

      void remove(){}
      // try the following line instead
      // void remove(H ^ h) {}

      void raise(){}
      // try the following line instead
      // void raise(String ^ s, int i) {}
   };
};