Skip to content

How to correctly do inheritance with runtimeclass using C++? #9904

Closed Answered by HO-COOH
HO-COOH asked this question in Q&A
Discussion options

You must be logged in to vote

Just post my answer here in case any one needed:

  • Include the implementation header in this derived runtimeclass's implementation header
  • In the implementation class's implementation header, add your base class in the DerivedT<...> argument list
#include "Base.h"
#include "Derived.g.h"
winrt::...::implementation
{
    struct Derived : Derived<Derived, Base> {...};
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by HO-COOH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant