microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

Proposal: Improve C++ tooling.

Open pjmlp opened this issue 4 years ago • 9 comments

Currently C++/WinRT developer experience still feels backward versus what C++/CX offers, the pain points being:

  • IDL files are required
  • no Visual Studio tooling support for IDL files, which turns the experience akin to using plain old Notepad
  • added burden to manually compile those IDL files and then merge their contents into existing code
  • although the documentation has been greatly improved, it still is quite overwhelming what one needs to understand to properly write full blown applications without landing into C++/CX samples or figuring out how to actually write some stuff in C++/WinRT.

Team should spend some time looking at cross platform C++ frameworks that offer first class developer experience if the goal is for us still care about Windows specific GUI frameworks.

Here are some examples that excel in C++ developer tools for GUI development.

https://www.noesisengine.com/index.php (with support for XAML even)

https://www.qt.io/product/development-tools

https://www.embarcadero.com/products/cbuilder

pjmlp avatar Feb 03 '21 07:02 pjmlp

@kennykerr FYI

StephenLPeters avatar Feb 04 '21 00:02 StephenLPeters

Agreed - @Scottj1s and I worked on a prototype for getting rid of IDL a while back. It showed a lot of promise.

kennykerr avatar Feb 04 '21 00:02 kennykerr

I am aware of that session, basically the "we should put up with C++/WinRT tooling and wait for the day C++ gets reflection" answer, or just ignore WinUI and go cross platform with one of the previously mentioned C++ frameworks from the competition.

pjmlp avatar Feb 04 '21 07:02 pjmlp

wait for the day C++ gets reflection

Actually that demo illustrated how it could be done with today's C++, but it still requires some work to complete that experience.

kennykerr avatar Feb 04 '21 15:02 kennykerr

Good news then, anything that can be shared besides just hoping C++/WinRT will ever match the cross-platform competition?

pjmlp avatar Feb 04 '21 20:02 pjmlp

One year and half have gone by, and the C++/WinRT tooling in Visual Studio hasn't changed a bit, is there any hope to actually be able to enjoy a modern tooling experience for WinUI apps with C++?

As it is, C++ Builder and QtCreator seem to be the only way forward.

pjmlp avatar Sep 12 '22 05:09 pjmlp

Has anything changed from 3 years ago? I tried using C++/WinRT yesterday and couldn't get even the simplest usage working. Code wouldn't compile but there were zero errors - just one snapshot of the issues I had in the day. It seems like C++/WinRT is too fragile and completely hostile to beginners and casual users. And the setup isn't automated?

"It seems like C++/WinRT is too fragile and completely hostile to beginners and casual users." - this is something Microsoft have really struggled with. Microsoft and its community have great difficulty acknowledging these kinds of issues. Experts gaslight casuals, dismissing their experiences as unusual. While the hate for these technologies simmers in the broader community. And beginners are just plainly slapped in the face over and over again.

Gavin-Williams avatar Aug 06 '25 00:08 Gavin-Williams

@Gavin-Williams apparently there is no hope for C++/WinRT, as later in 2023

This isn't meant as a negative statement. cppwinrt has reached all of its goals and is generally considered complete and largely bug-free (1). Whether WinRT/WinUI/WinAppSDK is the future is debatable. My experience has shown me that the Windows operating system is at its best when you embrace the Windows API as a whole, including Win32/COM/WinRT, and not just the latest shiny wave. You can see this in action with the popularity of projects like win32metadata and windows-rs that support both WinRT and non-WinRT APIs seamlessly.

https://github.com/microsoft/cppwinrt/issues/1289

So anyone trying to use C++ in WinUI applications is stuck with a project that never achieved feature parity with C++/CX tooling, because whoever at management level allowed this endevour to take place never cared about the actual paying customers, only pushing their agenda forward.

Unfortunely there is a certain lack of honesty when Microsoft talks publicly about WinUI, being able to use it in C++, and great experiences, whatever that may mean in the current state of Visual Studio tooling for WinUI/C++, versus what Qt, C++ Builder, and even more recent than 2021, Slint, are capable of.

Those three vendors tend to be the frameworks I advocate for when someone asks about doing C++ GUI development on Windows.

pjmlp avatar Aug 06 '25 06:08 pjmlp

@Gavin-Williams Try to use WinUI3/C++WinRT is a great challenge, which means you need to know the WinUI basic design mode (MVVM) like WPF(C#) for the first step, modern C++(at least 17, now it's 20), IDL 3.0 language (a must for xaml complier), XAML, COM (for complex debug). UWP C++/WinRT part is importent as the appetizer, windows app sdk APIs are your cookbook(include this), I'll tell you that each of them is not easy especially for developers without development experience.

hoshiizumiya avatar Nov 06 '25 17:11 hoshiizumiya