Skip to main content

C++/WinRT is a standard, native C++17 language projection for the Windows Runtime using modern C++ guidelines. It is the preferred alternative to C++/CX and WRL. This tag should be used with questions concerning using the features and functionality of C++/WinRT. Add the appropriate tag for the application type such as UWP as well. C++/WinRT is not C++/CX nor WRL so questions regarding those should probably not use this tag.

C++/WinRT is a language projection or application interface for Windows Runtime APIs. It is a header file based library written in modern C++17.

It is the preferred alternative to using WRL or C++/CX as it is native C++17, not using Microsoft C++ extensions as is used with C++/CX, and uses the modern C++ approach ( see https://moderncpp.com/ ).

C++/WinRT was originally a separate project with an SDK which has, with recent (Jun-2018) Windows 10 builds, been rolled into Windows 10 build 1803.

At least Visual Studio 2015 with Upgrade 3 C++17 updates with the improved C++17 conformance is suggested for C++/WinRT.

When developing C++/WinRT applications on Windows 10 earlier than Build 1803, the C++/WinRT SDK is required. There is also a C++/WinRT Extension for Visual Studio which contains several app templates.

See Introduction to C++/WinRT at https://learn.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/intro-to-using-cpp-with-winrt

The Windows Runtime or WinRT is a COM based library that is used with UWP apps to provide a standard library of functionality that replaces the use of the Win32 API of Windows. Using the WinRT allows a UWP application a degree of portability to be able to target any hardware which supports Windows 10, Windows 10 IoT, and Windows 10 IoT Enterprise.

C++/WinRT can be used for UWP apps or with Windows Desktop applications and can be mixed into C++ applications using other frameworks such as MFC so long as the application can build with C++17, a requirement for using C++/WinRT.