The first step toward full C++/WinRT support within Visual Studio and the eventual retirement of C++/CX happened today with the availability of build 17025 of the Windows SDK Insider Preview. With this update it means that you no longer need to download or clone the C++/WinRT repo on GitHub and can simply #include the appropriate headers from within any C++ project. What this also means is that you no longer need to wait for us to update GitHub following the release of a new Windows SDK. Indeed, we will no longer be publishing the updated headers on GitHub at all since you can get them directly from the Windows SDK.
If you look inside the Windows SDK include folder for build 17025 you’ll notice a new cppwinrt folder.
As full Visual Studio integration is still on the way, there are a few things you need to be mindful of. First, you need to make sure that the Windows SDK Version in the project is set to 17025 or later. New projects will default to this, but existing projects may need to be updated.
Second, C++/WinRT relies on C++17 language features and as such you need to tell Visual C++ that your project requires the C++17 language standard. This may soon be the default as well.
At this point, you can simply #include any of the C++/WinRT headers and start writing code! 🙂
If you prefer, you can also link to the windowsapp lib via the project settings rather than the pragma above.
Building from the command prompt won’t work yet as Visual Studio itself needs an update to pick up the cppwinrt folder.
Unfortunately, the cppwinrt.exe tool itself did not make it into this build of the Windows SDK. You should expect that in the next update, hopefully later this month. At that point you will also have the ability to generate your own headers and try the experimental support for component authoring. Until then, I hope you enjoy the new Windows SDK experience.