NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error C3716

'method': improper syntax for 'method'

You called __hook or __unhook with an incorrect syntax. To fix this error, ensure that your __hook and __unhook calls specify pointers to valid classes.

The following sample generates C3716:

[event_source(native)]
class CEventSrc {
public:
   __event void event1();
};

[event_receiver(native)]
class CEventRec {
public:
   void handler1() {
   }

   void HookEvents(CEventSrc* pSrc) {
      CEventRec* pRec = this;
      int __hook  = 0;   // C3716
      // try the following line instead
      // __hook(CEventSrc::event1, pSrc, CEventRec::handler1);
   }

   void UnhookEvents(CEventSrc* pSrc) {
      __unhook(CEventSrc::event1, pSrc, CEventRec::handler1);
   }
};

void main() {
}