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 C3257

'object' : cannot create a temporary of a managed class

You cannot create temporary, stack-based objects for managed classes. The compiler attempted to create a temporary object that is not directly mentioned in the code. This temporary object is created on the stack because there is no call to new.

The following sample generates C3257:

#using <mscorlib.dll>
__gc class X {
   public:
   X();
   X(int i) {
      X();   // C3257
   }
};

void main() {
}