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 C3351

'object' : if you pass a NULL object instance to a Delegate constructor you must also pass the address of a static member function

The compiler expected the address of a function declared static.

The following sample generates C3351:

#using <mscorlib.dll>

__delegate int D(int, int);

__gc class C {
public:
   int mf(int, int) {
   // declare the function as static
   // static int mf(int, int) {
      return 1;
   }
};

void main() {
   C *pC = new C;

   System::Delegate *pD = new D(0, &C::mf);   // C3351
}