Questions tagged [c++-winrt]
C++/WinRT is a standard, native C++17 language projection for the Windows Runtime using modern C++ guidelines. It is the preferred alternative to C++/CX and WRL. This tag should be used with questions concerning using the features and functionality of C++/WinRT. Add the appropriate tag for the application type such as UWP as well. C++/WinRT is not C++/CX nor WRL so questions regarding those should probably not use this tag.
c++-winrt
717
questions
0
votes
0
answers
56
views
C++/WinRT RequestAsync memory leak
I'm trying to figure out the cause of a memory leak in the following program. Running it causes memory usage to increase from 2MB -> 5MB (as reported by Visual Studio diagnostic tools) in about ...
0
votes
0
answers
64
views
How to utilize SetColor(Windows::UI::Colors::Red) from a Non-UWP and Non-C++/WinRT DLL file?
I have developed a C++ DLL without utilizing UWP or C++/WinRT. Within this DLL, I am employing Windows::Devices::Lights::LampArray^ lamp to retrieve information about the lamp, such as lamp->...
1
vote
1
answer
108
views
How to implement unit tests for WinUI3 (C++) application
At the moment, I have created a test project using a project template from Visual Studio Unit Test App (Winui 3) and my code looks like this
namespace TestMyWinrtApp
{
TEST_CLASS(CppUnitTests)
...
0
votes
1
answer
86
views
Unpackaged Desktop App: Binding to own dependency properties is not working
The demo project contains a simple GUI with a button and a derived user control MyUserControl.
MyUserControl only contains a border whose background is bound to the background of the user control:
...
0
votes
0
answers
59
views
CAtlServiceModuleT and CoInitializeSecurity: what to set?
We have a service created with CAtlServiceModuleT hosting one single COM coclass. The documents doesn't really tell much, but by experiment I found out that in order to allow non-elevated processes to ...
0
votes
2
answers
96
views
FileOpenPicker "invalid window handle" exception
This is a follow-on question to Guarang Dave's question. With @Simon_Mourier's help, he figured it out, but I still haven't. I'm trying to do what ought to be a simple task: open a FileOpenPicker ...
0
votes
0
answers
68
views
C++/WinRT idiomatic way to dispose of smart pointer class fields
Say I have a basic WinRT class:
// midl
runtimeclass Class: IClosable
{
Class();
}
// .h
struct Class : ClassT<Class>
{
Class() = default;
void Close();
~Class();
private:
...
0
votes
0
answers
68
views
Acrylic does not work properly. Start the APP before turning on the transparency effect
1.Start the app after turning off the transparency effect in Windows 11 settings.
After launching the app and then turning on the transparency effect from Windows settings, Acrylic will not work ...
0
votes
0
answers
57
views
StoreContext.GetAppLicenseAsync returns no cached license when device is offline
This is a classic Win32 application distributed on MS Store.
At startup, it checks the status of the product license. See excerpt below (C++/WinRT):
#include <Windows.Foundation.h>
#include <...
0
votes
1
answer
40
views
Use `winrt.windows.media.control` in Node.js or Rust
In the following python code I get the currently playing media / music from windows.
To display it on a electron app i would prefer to get the data using Node.js (or Rust for Tauri):
import asyncio
...
1
vote
1
answer
111
views
Callback for monitoring the creating of files/folder and the changes in the files in Cloud Files API
In Cloud Files API, the platform invokes the respective callback function for the callback types.
there is a callback type for everything - reading, moving, deleting, renaming, list fetching - but I ...
0
votes
1
answer
52
views
IJsonValue.GetObject Method collides with windows.h macro
https://learn.microsoft.com/en-us/uwp/api/windows.data.json.ijsonvalue.getobject?view=winrt-22621
#include <winrt/Windows.Data.Json.h>
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <...
0
votes
0
answers
36
views
Im trying to read a file in cpp/clr and perform calculations on it and display it using GUI but Im getting errors Im not familair with
I am opening the file in binary mode and trying to get the first digit (number_of_poly) in the first row, the total number of rows, and the second digit (number_of_vars) in the second row, the total ...
0
votes
0
answers
126
views
How to use C++/WinRT API as part of C++ DLL without relying on the UWP UI portion?
I am attempting to utilize the C++/WinRT code provided in the sample of LampArray, cppwinrt to create a C++ DLL. However due to the tight coupling of this sample with the UI, I am not able to use ...
5
votes
0
answers
66
views
How to attach Nuget package.config file for C++ cmake project
I’m working on CPP WinUI3 desktop application with cmake. By default WinUI3 project uses MSBuild. We made the project use cmake with the help of this sample project. ref - https://github.com/...