Teilen über


Compilerfehler C3911

"event_accessor_method": Die Funktion muss den Typ "Signatur" aufweisen.

Bemerkungen

Die Accessormethode eines Ereignisses wurde nicht ordnungsgemäß deklariert.

Weitere Informationen finden Sie unter "Event".

Example

Im folgenden Beispiel wird C3911 generiert:

// 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) {}
   };
};