'type1' : 無法繼承自 'type2',ref 類別只能繼承自 ref 類別或介面類別
備註
您嘗試使用 Unmanaged 類別做為 Managed 類別的基類。
Example
下列範例會產生 C2811:
// C2811.cpp
// compile with: /clr /c
struct S{};
ref struct T {};
ref class C : public S {}; // C2811
ref class D : public T {}; // OK
'type1' : 無法繼承自 'type2',ref 類別只能繼承自 ref 類別或介面類別
您嘗試使用 Unmanaged 類別做為 Managed 類別的基類。
下列範例會產生 C2811:
// C2811.cpp
// compile with: /clr /c
struct S{};
ref struct T {};
ref class C : public S {}; // C2811
ref class D : public T {}; // OK