To develop WinUI3 applications using standard C++, you use the Windows App SDK and C++/WinRT. This workflow relies on the XAML compiler to generate implementation headers from Interface Definition Language (IDL) files. These generated headers allow you to implement local Windows Runtime classes that are referenced within your app's XAML pages.
Follow these steps to set up your class implementations:
- Define Interfaces: Create an
.idl file to define any local Windows Runtime classes that your XAML pages will reference. - Generate Templates: Build the project. This triggers the generation of implementation templates in the
Generated Files folder and skeleton class definitions in Generated Files\sources. - Implement Classes: Use the generated skeleton class definitions as a reference to write the actual logic for your Windows Runtime classes.
1. Create an interface (IDL) file...
2. Build the project once to generate implementation templates...
3. Use the skeleton class definitions for reference...