WinUI in Desktop with C++

Karan Ahlawat 1 Reputation point
2021-06-29T17:39:36.933+00:00

Hello, I am quite new to application development on and for Windows. I have learnt some beginner stuff for making WinUI applications in C#, thanks to all the resources out there.
But, the resources for doing the same in C++ are quite few in number, and not very approachable for someone who does not know anything about how C++ application development works. The MSFT documentation isn't of much help either.

Hence, can anyone recommend some good resources that aren't aimed at experienced people, for getting started with WinUI with C++, and WinRT/C++?

Universal Windows Platform (UWP)
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,518 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 81,461 Reputation points
    2021-06-29T19:11:29.207+00:00

    Usually, everything is in MSDN, but there are not a lot of things for C++/WinUI, WinUI being a new technology.
    (I use C++/Win32, other people use MFC, or there is also C++/CLI (like C#)) :

    Create your first WinUI 3 app
    Windows App SDK Hello World Sample


  2. Sam of Simple Samples 5,516 Reputation points
    2021-06-29T22:48:26.473+00:00

    I wish I could give you an answer you would like. Unfortunately Microsoft has made things really complicated. I have even read that they are moving away from UWP.

    For what it is worth, there is something new for making applications that can execute in most major environments, not just Windows; see:

    I am not sure how useful that is to you but it is another complication.

    There was something called either C++/CLI or CLI/C++; I have seen both. It is a non-standard managed version of the C++ language.

    Then there was C++/CX. I know nothing about it. But then Microsoft developed C++/WinRT. See the following.

    I think that C++/WinRT is worth learning. I am still using VS 2017 and I generated a C++ UWP program. I am not sure but I think it is using C++/CX. So unfortunately there are no easy answers but if you are using VS 2019 then try generating a C++ UWP program. I am not sure but as best as I can see if it uses C++/WinRT then there will be a NuGet package for that.