'function' : cannot declare a managed object or a gc pointer within an unmanaged function
Unmanaged functions cannot declare managed objects or pointers to managed objects.
The following sample generates C3169:
#using <mscorlib.dll> __gc class A { }; #pragma unmanaged // remove this line to resolve void func() { A __gc* a; // C3169 } #pragma managed void main() { }