C++/WinRT overcorrection: Using make_self and immediately converting it to the projected interface
cppdashboard.dev/r/2026/10/cpp-winrt-overcorrection-using-make-self-and-immediately-conThis article discusses the two ways of creating objects in C++/WinRT, focusing on the use of make_self and its conversion to the projected interface. It explains the implications of choosing one method over the other based on access needs.
From the article
In C++/WinRT, there are two ways of creating objects that you yourself implement.
For the purpose of this discussion, let Impl be the class you wrote that implements a Windows Runtime object. If you are implementing something that was declared in an IDL file, it will be the winrt:: Namespace:: implementation:: ClassName for the instance object or it will be the winrt:: Namespace:: factory_ implementation:: ClassName for the factory object. If it wasn’t declared in an IDL file, then it is the class that you manually derived from winrt:: implements .
One way to create the object is to use make<Impl> , which creates the implementation object and then returns the Windows Runtime projection version of that object. (If Impl is manually-derived from winrt:: implements , the projection is the…
Share this resource