共用方式為


編譯器錯誤 C3628

'base class' :Managed 或 WinRTclasses 僅支持公用繼承

嘗試使用Managed或 WinRT 類別作為 私人受保護的 基類。 Managed 或 WinRT 類別只能作為具有公用存取權的基類。

下列範例會產生 C3628,並顯示如何修正此問題:

// C3628a.cpp
// compile with: /clr
ref class B {
};

ref class D : private B {   // C3628

// The following line resolves the error.
// ref class D : public B {
};

int main() {
}