Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Implicitly Abstract Classes

Implicitly Abstract Classes

If a class has interface base type, and if the class does not implement all the interface's member functions, then the class is implicitly abstract, and you cannot instantiate the class.

For more information about abstract classes, see abstract.

// mcppv2_ref_class5.cpp
// compile with: /clr
interface struct MyInterface {
   void func1();
   void func2();
};

ref class MyClass : public MyInterface {
public:
   void func1(){}
   // void func2(){}
};

int main() {
   MyClass ^ h_MyClass = gcnew MyClass;   // C2259 
                        // uncomment MyClass::func2 to resolve
}

Community Additions

ADD
Show:
© 2015 Microsoft