Skip to content

Conversation

@SternXD
Copy link
Contributor

@SternXD SternXD commented Dec 31, 2025

Description

Migrates the UWP code from C++/CX to C++/WinRT.

C++/CX is a deprecated, non-standard language extension. C++/WinRT is the replacement, giving us better compatibility and support. I have smoke tested this for a few hours with no regressions I could find.

EDIT here's what Microsoft says about it:

C++/WinRT is the recommended alternative to C++/CX. It is a new, standard C++17 language projection for Windows Runtime APIs, available in the latest Windows SDK from version 1803 (10.0.17134.0) onward. C++/WinRT is implemented entirely in header files, and designed to provide you with first-class access to the modern Windows API.
With C++/WinRT, you can both consume and author Windows Runtime APIs using any standards-conformant C++17 compiler. C++/WinRT typically performs better and produces smaller binaries than any other language option for the Windows Runtime. We will continue to support C++/CX and WRL, but highly recommend that new applications use C++/WinRT. For more information, see C++/WinRT.

Changes:

  • Replaced ref class with winrt::implements<>
  • Converted Platform::String^ to winrt::hstring
  • Updated event handlers to use C++/WinRT delegates with proper cleanup
  • Replaced ref new with winrt::make<>
  • Updated async helpers to use C++/WinRT IAsyncOperation and exception handling
  • Removed some duplicate includes that weren't needed
  • Added specific Xbox model detection (One, One S, One X, Series S, Series X) via Gaming Device Information API (this changes it from Xbox One/Series CPU in the system info to actually show what console the user is on)
Click to see Console Screenshot image
Click to see Desktop Screenshot image

Reviewers

@LibretroAdmin

@SternXD
Copy link
Contributor Author

SternXD commented Dec 31, 2025

whoops let me fix the CI :/

- Replace ref class with winrt::implements<>
- Convert Platform::String^ to winrt::hstring
- Update event handlers to C++/WinRT delegates
- Add PackageReference for auto NuGet restore
- Add specific Xbox model CPU detection via Gaming Device Info API

Signed-off-by: SternXD <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant