Compiler Error C3717


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at Compiler Error C3717.

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() {