none
Implementing multipleInterfaces in ATL Simple Object RRS feed

  • Question

  • I define in IDL interface A derived from IDispatch and interface B derived from A. Then I try to implement interface B in my ATL Simple object using Implement Interface context menu item.

    1. If I only add only interface B then the methods of the interface A are missing, VS 2015 wizard does not add them to the class.

    2. If I add both A and B the I get compilation error C2594: 'static_cast': ambiguous conversions

    What is the right way to add interfaces to the object?

    Friday, January 15, 2016 6:06 PM

Answers

  • On 1/15/2016 1:06 PM, VictorZaslavsky wrote:

    I define in IDL interface A derived from IDispatch and interface B derived from A. Then I try to implement interface B in my ATL Simple object using Implement Interface context menu item.

    1. If I only add only interface B then the methods of the interface A are missing, VS 2015 wizard does not add them to the class.

    2. If I add both A and B the I get compilation error C2594: 'static_cast': ambiguous conversions

    What is the right way to add interfaces to the object?

    Add both A and B, then manually remove "public A" from the list of base classes.

    Friday, January 15, 2016 11:25 PM