none
Can one ATL wizard-generated class derive from another ATL wizard-generated class? RRS feed

  • Question

  • I was wondering if it's possible for one ATL wizard-generated class to inherit directly from another ATL wizard-generated base class.  When I tried adding the inheritance syntax to the derived class declaration, I got all sorts of squiggly error lines around the ATL COM map macros.  Can it be done by removing those macros?  Or some other way?  Thanks for any input.  I'm still just beginning to learn how ATL works.

    • Edited by amt528 Tuesday, October 22, 2019 2:53 PM
    Tuesday, October 22, 2019 2:51 PM

All replies

  • The classes created by the ATL wizard are designed to be instantiated as COM objects that implement interfaces. 

    What are you really trying to accomplish here?

    Tuesday, October 22, 2019 3:00 PM
  • Well I've got two classes, which are property handlers (you may remember me from my other questions).  I realized that one property handler does everything that the other does, but needs to override just a little bit of functionality.  So even though they have to be two different handlers, which are registered, instantiated, etc., I was wondering if one could inherit from the other.
    Tuesday, October 22, 2019 3:03 PM
  • This is essentially the same question that was asked earlier.  You can use a plan old C++ class as a base class to provide common functionality
    Tuesday, October 22, 2019 3:12 PM