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 C3145

'object' : cannot declare a global or static managed object or a gc pointer

You can only define NGWS objects within function scope.

The following sample generates C3145:

#using <mscorlib.dll>
Object *o;   // C3145, declaring in main is OK
__gc class X {
public:
   void mf() {
      static X *pX = new X();   // C3145
      // try the following line instead
      // X *pX = new X();
   }
};

void main() {
   Object *p;
}