Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
'method': a method that fires events cannot be defined
Remarks
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.
Example
The following example generates C3717:
// C3717.cpp
[event_source(native)]
class CEventSrc {
public:
__event void event1() { // C3717
}
// remove definition for event1 and substitute following declaration
// __event void event1();
};
[event_receiver(native)]
class CEventRec {
public:
void handler1() {
}
void HookEvents(CEventSrc* pSrc) {
__hook(CEventSrc::event1, pSrc, CEventRec::handler1);
}
void UnhookEvents(CEventSrc* pSrc) {
__unhook(CEventSrc::event1, pSrc, CEventRec::handler1);
}
};
int main() {
}