नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'function': improper syntax for specifying event in __hook/__unhook
Remarks
When you specify an event source with __hook or __unhook, the first parameter must be a valid event method and the second parameter must be a valid event source object (not a method).
Example
The following example generates C3709:
// C3709.cpp
// compile with: /LD
[event_source(native)]
class CEventSrc
{
public:
__event void event1();
};
[event_receiver(native)]
class CEventRec
{
public:
void handler1()
{
}
void HookEvents(CEventSrc* pSrc)
{
__hook(bad, pSrc, CEventRec::handler1); // C3709
// Try the following line instead:
// __hook(&CEventSrc::event1, pSrc, CEventRec::handler1);
}
void UnhookEvents(CEventSrc* pSrc)
{
__unhook(&CEventSrc::event1, pSrc, CEventRec::handler1);
}
};