Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVDAHelper Windows 10, switch from WRL/CXX to C++/WinRT #10662

Closed
LeonarddeR opened this issue Jan 7, 2020 · 4 comments · Fixed by #11768
Closed

NVDAHelper Windows 10, switch from WRL/CXX to C++/WinRT #10662

LeonarddeR opened this issue Jan 7, 2020 · 4 comments · Fixed by #11768
Milestone

Comments

@LeonarddeR
Copy link
Collaborator

We are using Windows Runtime C++ Template Library (WRL) to in operate with Windows OneCore APIs, particularly the OCR and ONeCore APIs.

From the WRL Docs:

WRL is now superseded by C++/WinRT, a standard C++17 language projection for Windows Runtime APIs. C++/WinRT is available in the Windows 10 SDK from version 1803 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-compliant 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.

While NVDA works with WRL just fine, we should investigate a switch to WinRT as soon as new features have to be added to the Windows 10 local lib.

@LeonarddeR
Copy link
Collaborator Author

Blocked by #9661

@codeofdusk
Copy link
Contributor

#9661 has been merged, so this issue is no longer blocked.

@feerrenrut
Copy link
Contributor

Further investigation will need to be done into the implications of this work.

@LeonarddeR LeonarddeR changed the title NVDAHelper Windows 10, switch from WRL to C++/WinRT NVDAHelper Windows 10, switch from WRL/CXX to C++/WinRT Oct 15, 2020
@LeonarddeR
Copy link
Collaborator Author

Resources relevant for this process:

We also need to find out how to write directly to a buffer (utils.cpp)

feerrenrut pushed a commit that referenced this issue Jan 19, 2022
Closes #10662

Summary:
Interaction with the Windows 10 UWP/OneCore APIs was performed using C++/CX code.
This is an extension to the C++ language that which dialect is sometimes a bit different
from standard C++.

C++/CX is superseded by C++/WinRT. which is a C++20 language projection.
Using this results in code that is IMO much more readable to people who know C++ but
are not accustomed to the CX dialect.
It also uses C++ coroutines instead of the Parallel Patterns Library.
Not to mention that CX is likely to be deprecated in the future.

Description of change:
Converts all C++/CX and WRL code to its equivalent in C++/WinRT.
While at it, I converted the OcSpeech and UwpOcr structs to classes that hold the speech
synthesis and OCR engines as private members, ensuring that the exported functions could
only access the things they need.
@nvaccessAuto nvaccessAuto added this to the 2022.1 milestone Jan 19, 2022
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 a pull request may close this issue.

4 participants