'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(); }