Compiler Error C3288

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C3288.

type' : illegal dereference of a handle type

The compiler detected an illegal dereference of a handle type. You can dereference a handle type and assign it to a reference. For more information, see Tracking Reference Operator.

The following sample generates C3288.

// C3288.cpp  
// compile with: /clr  
ref class R {};  
int main() {  
   *(System::Object^) nullptr;   // C3288  
  
// OK  
   (System::Object^) nullptr;   // OK  
   R^ r;  
   R% pr = *r;  
}  

Show: