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 C3175

'function1' : cannot call a method of a managed class from unmanaged function 'function2'

Unmanaged functions cannot call member functions of managed classes.

The following sample generates C3175:

#using <mscorlib.dll>

__gc struct A {
   static void func() {
   }
};

#pragma unmanaged      // remove this line to resolve

void func2() {   
   A::func();         // C3175
}

#pragma managed      

void main() {
   A *a = new A;
   func2();
}