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 C3742

'type': could not convert to System::Type*

An attempt was made to use the typeof operator on an unmanaged type.

The following sample generates C3742:

#using <mscorlib.dll>
using namespace System;

__nogc struct MyStruct {
};

// try the following lines instead
// __gc struct MyStruct {
// };

[attribute(All)]
__gc struct AtClass {
   AtClass(System::Type*) {
   }

   AtClass(String*) {
   }

   AtClass(int) {
   }
};

[AtClass(typeof(MyStruct))]
struct B {   // C3742
};

void main() {
}