This documentation is archived and is not being maintained.

Compiler Error C3717

Error Message

'method': a method that fires events cannot be defined

You declared an event method that includes an implementation. An __event method declaration cannot have a definition. To fix this error, ensure that no event method declarations have definitions. For example, in the code below, remove the function body from the event1 declaration as indicated by the comments.

The following sample generates C3717:

// C3717.cpp
class CEventSrc {
   __event void event1() {   // C3717

   // remove definition for event1 and substitute following declaration
   // __event void event1();

class CEventRec {
   void handler1() {

   void HookEvents(CEventSrc* pSrc) {
      __hook(CEventSrc::event1, pSrc, CEventRec::handler1);

   void UnhookEvents(CEventSrc* pSrc) {
      __unhook(CEventSrc::event1, pSrc, CEventRec::handler1);

int main() {