This documentation is archived and is not being maintained.

Compiler Error C3713

Error Message

'method': an event handler method must have the same function parameters as the source 'method'

You defined an event handler method that did not use the same parameters as the source event method. To fix this error, give the event handler method the same parameters as those of the source event method.

The following sample generates C3713:

// C3713.cpp
// compile with: /c
class CEventSrc {
   __event void event1(int nValue);
   // try the following line instead
   // __event void event1();

class CEventRec {
   void handler1() {}

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

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