Implicitly Abstract Classes
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

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 {
   void func1(){}
   // void func2(){}

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