Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Compiler Error C3909

a managed event declaration must occur in a managed type

A managed event was declared in a native type.

For more information, see event.

The following sample generates C3909:

// C3909.cpp
// compile with: /clr /c
delegate void H();
class X {
   event H^ E;   // C3909
};

ref class Y {
   static event H^ E {
      void add(H^) {}
      void remove( H^ h ) {}
      void raise( ) {}
   }
};

Community Additions

ADD
Show:
© 2015 Microsoft