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
[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() {
}
Athugasemdir
https://aka.ms/ContentUserFeedback.
Væntanlegt: Á árinu 2024 munum við hætta með GitHub-mál sem ábendingaleið fyrir efni og skipta því út fyrir nýtt ábendingakerfi. Frekari upplýsingar er að finna hér:Senda inn og skoða endurgjöf fyrir