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 C3277

'object' : an instance of an unmanaged class cannot be embedded within a managed class

The compiler does not allow you to instantiate an unmanaged class inside a managed class. It is possible, though, to have a pointer to an unmanaged class inside a managed class.

The following sample generates C3277:

#using <mscorlib.dll>
class X {
public:
   void mf();
};

__gc class Y {
private:
   X m_data;   // C3277
   // The following line resolves the error.
   // X* m_data;
};

void main() {
}