नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'method': an non-managed event source method must return void or an integral type
Remarks
You defined a method in the event source that did not return void or an integral type. To fix this error, make the event and event handler have a return type of void or an integral type such as int or long.
Example
The following example generates C3711:
// C3711.cpp
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>
[event_source(native)]
class CEventSrc {
public:
__event float event1(); // C3711
// try the following line instead
// __event int event1();
// also change the handler, below
};
[event_receiver(native)]
class CEventRec {
public:
float handler1() { // change float to int
return 0.0; // change 0.0 to 0
}
void HookEvents(CEventSrc* pSrc) {
__hook(CEventSrc::event1, pSrc, CEventRec::handler1);
}
void UnhookEvents(CEventSrc* pSrc) {
__unhook(CEventSrc::event1, pSrc, CEventRec::handler1);
}
};
int main() {
}