The C++/WinRT query_interface_tearoff extension point, and using it for COM aggregation

1 · Raymond Chen · Sept. 13, 2021, 2:22 p.m.
The C++/WinRT library’s implements template does the heavy lifting of implementing COM classes. One of the extension points is a method called query_interface_tearoff. This method is called as part of the implementation of the IUnknown::Query­Interface method if the caller is asking for an interface that wasn’t declared as part of the implements type parameter list. The post The C++/WinRT <CODE>query_<WBR>interface_<WBR>tearoff</CODE> extension point, and using it for COM aggregation appeared fi...