Condividi tramite


Errore del compilatore C3265

non può dichiarare un 'costrutto gestito' gestito in un 'costrutto non gestito'

Non è possibile includere un oggetto gestito in un contesto non gestito.

L'esempio seguente riproduce C3265:

// C3265_2.cpp
// compile with: /clr /LD
#include <vcclr.h>

ref class A { };

class B
// try the following line instead
// ref class B
{
   A ^a;   // C3265
   // or embed the managed handle using gcroot
   // try the following line instead
   // gcroot<A^> a;
};