title: C++: Derived + Base class implement a single interface?
body: <p>In C++, is it possible to have a base plus derived class implement a single interface?</p>
  
  <p>For example:</p>
  
  <pre><code>class Interface
  {
      public:
          virtual void BaseFunction() = 0;
          virtual void DerivedFunction() = 0;
  };
  
  class Base
  {
      public:
          virtual void BaseFunction(){}
  };
  
  class Derived : public Base, public Interface
  {
      public: 
          void DerivedFunction(){}
  };
  
  void main()
  {
      Derived derived;
  }
  </code></pre>
  
  <p>This fails because Derived can not be instantiated. As far as the compiler is concerned Interface::BaseFunction is never defined.</p>
  
  <p>So far the only solution I've found would be to declare a pass through function in Derived</p>
  
  <pre><code>class Derived : public Base, public Interface
  {
      public: 
          void DerivedFunction(){}
          void BaseFunction(){ Base::BaseFunction(); }
  };
  </code></pre>
  
  <p>Is there any better solution?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> If it matters, here is a real world problem I had using MFC dialogs. </p>
  
  <p>I have a dialog class (MyDialog lets say) that derives from CDialog. Due to dependency issues, I need to create an abstract interface (MyDialogInterface). The class that uses MyDialogInterface needs to use the methods specific to MyDialog, but also needs to call CDialog::SetParent. I just solved it by creating MyDialog::SetParent and having it pass through to CDialog::SetParent, but was wondering if there was a better way.</p>