次の方法で共有


コンパイラ エラー C3265

アンマネージド 'unmanaged construct' でマネージド 'managed construct' を宣言できません

アンマネージド コンテキストにマネージド オブジェクトを含めることはできません。

次の例では 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;
};