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 C3363

'delegate' : cannot create a Delegate from member of unmanaged class

A method from an unmanaged class was used in the creation of a delegate. Methods used in the creation of a delegate must come from a managed class.

The following sample generates C3363:

#using <mscorlib.dll>
__delegate String* md(int x);

__nogc class td {
// try the following line
// __gc class td {
   public:
      String* method(int x) { 
         return Int32::ToString(x);
      };
   };

void main() {
   td* x = new td();
   md* dx = new md(x, td::method);   // C3363
}