786 questions
0
votes
0
answers
17
views
Microsoft Store (Windows.Store.Services) How to handle and test parental authorisation for in-app purchases?
Using the C++/WinRT APIs for Microsoft Store apps (Windows.Store.Services), what is the flow for in-app purchases that require parental authorisation, and how do I test this?
Flow:
User attempts ...
1
vote
1
answer
61
views
How to make a call once callback in C++winrt using smart pointers
I have to modify an existing Control using the Loaded event from a static member function that has to:
Not storing the revoker into some class member because the code is inside a static function. ...
0
votes
0
answers
78
views
Consume a C# component with WinUI 3 controls from a WinRT/Win32 project
I followed this tutorial https://learn.microsoft.com/en-us/windows/apps/develop/platform/csharp-winrt/create-winrt-component-winui-cswinrt and I would like to do the same thing but from a Win32 ...
1
vote
1
answer
63
views
How to use WinAPi in a C++ WinRT Component?
I'm creating a C++ WinRT runtime component using Visual Studio 2022.
I want to use functions like PeekMessage() to handle a basic message loop. However, I get the following errors:
error C3861: '...
0
votes
0
answers
140
views
Microsoft C++ exception: winrt::hresult_class_not_registered at memory location
I was trying the sample code from here
While trying to execute cpp-console-unpackaged sample of Push Notification, I am facing error:
Unhandled exception at 0x00007FFE067101DC in ConsoleApplication2....
0
votes
0
answers
37
views
How to create a Clickable Image or Image Button in WinRT/C++
I actually struggle to find a way to make a Image clickable or generate a Image Button in XAMl. There is even no Documentation on how to generate a Simple Image Button.
Tried to find Image Button. ...
0
votes
0
answers
61
views
How to Process Low latency input in winui3 (WindowsAppSDK) like uwp
In my UWP project I am using CoreDispatcher.ProcessEvents function
like mentioned in https://github.com/microsoft/Windows-universal-samples/blob/main/Samples/LowLatencyInput/
I want to convert it for ...
0
votes
0
answers
116
views
Where are these runtime startup/shutdown errors coming from using C++ WinRT/WinUI-3?
I have created a small C++ WinRT/WinUI-3 project to isolate the errors I've been experiencing. I start with a Blank App, Packaged (WinUI 3 in Desktop) using VS2022 V17.13.6 solution. Then I strip out ...
0
votes
1
answer
84
views
Can't get SelectedValue in WinUI 3 ComboBox to work
I tried this with String (hstring) combo items and everything worked fine. Now I try to use structure and... trying to fill ComboBox and select one of them.
ComboBox is filled ok, but no item is ...
0
votes
1
answer
39
views
Windows runtime component project doesn't generate cpp and h skeletons
In Visual Studio 2022, there is a C++ Windows Runtime Component Project. I can use this, I suppose, to generate a skeleton given a Windows MIDL file. Then I go in and fill in the skeleton with my ...
0
votes
0
answers
314
views
How to create a Windows Application Packaging project for a C++WinRT UWP app?
I need to package a UWP app written with C++WinRT and a full trust win32 exe. I found no documentation about how to do this. The UWP C++WinRT project template only provides self-packaging with msix.
...
0
votes
1
answer
39
views
Can one use MKL with C++/WinRT?
I'd like to use Intel's Math Kernel Library (MKL) to do some calculations. I've figured this out for MFC programs, but I'm having trouble with C++/WinRT & WinUI 3 programs. For a repro, I took ...
0
votes
1
answer
74
views
How to use `TextGetOptions` in `RichEditBox.TextDocument().GetText()` method with WinUI3 C++
I am using WinUI3 on C++ windows app. And I have to pass TextGetOptions to TextDocument().GetText() according to the document and visual studio intellisense.
void MainWindow::TextPreviewKeyDown(...
1
vote
1
answer
83
views
decoder.ptr was nullptr CreateDesktopWindowTarget - IDesktopWindowTarget [closed]
In C++, I want to load a image, and render it to a win32 window using winrt compositing. I'm just trying to build a simple test bed for my other app to test 2dtexture compositing.
I've tried many ...
0
votes
1
answer
111
views
GraphicsCaptureItem::CreateFromVisual but my input parameter is type Microsoft.UI.Composition.Visual instead of Windows
I'm migrating from UWP to WinUI3 and I'm trying to capture a screenshot of certain element in Xaml.
auto vis = ElementCompositionPreview::GetElementVisual(m_elementToCapture);
m_item = ...
0
votes
1
answer
64
views
winrt::hresult_class_not_registered - AudioEffectDefinition with custom effect
I'm trying to create a winrt custom audio effect using this tutorial.
#include "MyAudioEffect.g.h"
auto effectName = winrt::name_of<winrt::MRE_ClassNotRegistered::MyAudioEffect>();
...
-1
votes
1
answer
384
views
Class Not Registered when communicating C++/WinRT with C#/WinRT components that return IAsyncOperation<> or IList<>
I'm currently facing an issue where i am unable to create a C#/WinRT component that returns any complex types acceptable by WinRT, like IAsyncOperation<>., IAsyncAction or IList<>.
I have ...
0
votes
0
answers
210
views
WinRT prompt for MddBootstrapInitialize2 function suggests that this application cannot be started
I want the window to have a frosted glass effect, so I use windowsAppSdk in my win32 program. but when running into this code:
#include <Windows.h>
#include <MddBootstrap.h>
#include <...
1
vote
1
answer
479
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
2
answers
461
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
185
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
1
answer
197
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
...
0
votes
1
answer
145
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
204
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 ...
1
vote
0
answers
172
views
Control, created with C++/WinRT Component, doesn't appear in C#/WinRT App
I want to use C++ as part of WinUI3.
I'm facing an issue where the C# component displays properly, but the C++ component doesn't.
Result
Therefore, I followed a Microsoft article to implement a C++/...