Skip to content

roman380/CppWinrtApiTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++/WinRT API Template

This repository hosts a template Visual Studio 2019 solution to author API in C++/WinRT as described in the following MSDN article: Author APIs with C++/WinRT.

The Api project is a DLL library project which includes a WinRT IDL definition (see Introduction to Microsoft Interface Definition Language 3.0) which is compiled as a part of build process and a custom step generates module a implementation source code files to link the project into WinRT component library. The project produces .DLL code and .WINMD metadata output.

Consume project is straightforward consumption project in C++/WinRT which is consuming the API using a hook in activation factory lookup. The activation factory is loaded from a side loaded API library.

SharpConsume project is a standard .NET Framework console application project referencing WinRT component and importing API definitions from metadata.

Miscellaneous

As of now the template is minimalistic and is used with:

  • Visual Studio 2022
  • Windows 10 SDK 10.0.22621
  • C++/WinRT shipped with Windows 10 SDK
  • x64 platform

It is assumed that the project is generally compatible with Win32 and ARM, ARM64 platforms too.