8,727 questions
1
vote
1
answer
551
views
How to set ComboBoxItem property?
I am trying to hide an item in the Combobox when it has been selected and this is how my code looks like right now:
VeiwModel.cs
public class SortList
{
public string Key { ...
0
votes
2
answers
743
views
C++/WinRT extension vs NuGet package
Considering a C++/WinRT Visual Studio project, which one is recommended to be used between the C++/WinRT extension and the C++/WinRT NuGet package?
I currently have both installed and the project ...
0
votes
1
answer
208
views
How to return Non-Primitive types from C# winrt component to C++?
I currently have a working project where I am consuming a C# WinRT component in a win32 console app using Registration-free Winrt. Everything is working well, but the problem arises when I try to use ...
0
votes
1
answer
144
views
StorageProvider: What is populating and what does PopulationPolicy do?
I'm reading up on Cloud file storage, and ran across the PopulationPolicy property under Storage.Provider.StorageProviderSyncRootInfo, but I'm not sure what this does. The definition that msdn ...
0
votes
1
answer
150
views
UWP - How do I get StorageFolder from FolderInformation in C#?
I am using FileInformationFactory.GetVirtualizedFoldersVector method to populate a ListView control. GetVirtualizedFoldersVector returns a vector of IStorageItemInformation objects which in the folder'...
0
votes
0
answers
480
views
[winrt]Unable to initialize the base class of projected type
i'm a newer to cpp/winrt, i use implements_type and base_type to initialize the base class of projected type, but compile error.
namespace Velkhana
{
[default_interface]
unsealed runtimeclass Only{...
0
votes
0
answers
264
views
How to register the events using C++ WinRT in console application?
I'm trying to understand how to register the events using C++ WinRT using console application.
void Radio_StateChanged(Windows::Devices::Radios::Radio const& sender, Windows::Foundation::...
0
votes
0
answers
430
views
How to write the console application that register the events and it should be called whenever the radio state is changed through the windows setting
I'm trying to understand how to register the events using C++ WinRT using console application.
void Radio_StateChanged(Windows::Devices::Radios::Radio const& sender, Windows::Foundation::...
0
votes
0
answers
5k
views
"Cannot change thread mode after it is set" RunTime error in Python
I created a project that displays a Windows toast notification using the 'winrt' module. When I run my code in PyCharm, the script executes normally until completion. After compiling using PyInstaller ...
1
vote
0
answers
493
views
winrt::Windows::Media::Playback::MediaPlayer causing crash upon calling CopyFrameToVideoSurface
I want to extract raw frames or bitmaps from a video that I'm playing in my C++ console application using C++/WinRT APIs. I'm simply using CopyFrameToVideoSurface to copy the video's frame to a ...
3
votes
1
answer
969
views
Can you call from a C#/Winrt Component inside a base Win32 console template app (not WinForm/abstractions/wrappers or using the C++/Winrt template)?)
I have an existing program win32 (x86) console app that needs to call managed code (C# from a .Net .dll). The .dll is not exposed to COM, but can be called from a C#/WinRT Component and referenced by ...
0
votes
0
answers
330
views
What's the difference between a C++/WinRT template console app and a C++ console app with WinRT NuGet installed?
Here's the problem. I have a win32 (x86) program that has WinRT NuGet installed and working that needs to call a C# functions. I followed the instructions here and got everything working as a test C++/...
0
votes
0
answers
34
views
How to distribute a windows application that uses windows runtime in an installer?
I have a windows application that uses windows runtime and trying to install it dependencies on another windows machine. The linker is using WindowsApp.lib but I can't find a DLL with that library.
5
votes
1
answer
3k
views
How to use "webrtc.lib" static library in VS 2019 or CLion Project?
I have been working with WebRtc Development for the Windows Platform. I want to develop webrtc based desktop application. I am doing it from scratch for learning and better understanding.
The normal ...
2
votes
2
answers
4k
views
How do I open a new Window in WinUI3 with WinRT/C++?
How do I open a new window in WinRT / WinUI3? I want to click a button and open up another floating window on top of the current / main window.
I have tried code from several samples with zero luck:
...
-3
votes
2
answers
804
views
How to register radio StateChange event using C++ WinRT API
// Register
event_token StateChanged(TypedEventHandler<Radio, IInspectable const&> const& handler) const;
Can anyone please help with the code to register the events using C++ winRT. I'...
-1
votes
1
answer
471
views
How to detect network change events asynchronously using c++ WinRT
networkStatusCallback = new NetworkStatusChangedEventHandler(OnNetworkStatusChange);
if (!registeredNetworkStatusNotif)
{
NetworkInformation.NetworkStatusChanged += ...
4
votes
1
answer
819
views
apply pixel shader with WinRT's Windows.Graphics.Capture
The continuation of my previous question, I am able to find a way to capture a live screen without own window with help of WinRT's Windows.Graphics.Capture. I can concentrate directly on a particular ...
1
vote
2
answers
1k
views
WinUI 3 Desktop XAML Databinding - WinRT originate error - 0x8001010E when the Property is changed
I am following the BookStore data binding example, documented at XAML controls; bind to a C++/WinRT property, up to and including the "Bind the button to the Title property" section.
My ...
0
votes
0
answers
281
views
How to get the RECT during Windows Minimize, Maximize and Restore animation
Hi I am developing a project using C#/WPF and Windows.UI.Composition for creating acrylic effect in WPF.
Here is how my project looks like currently
Current Status
Usually rendering any Windows.UI....
0
votes
0
answers
261
views
How does Popup send message to Content and get response continuously and vise-versa?
What I'd like to do is to:
Popup Send Data Request to Content -> Content Receive Request, Send Data (listData) -> Popup Receive Data.
Then, if content change its elements,
Content Send Message -...
3
votes
0
answers
774
views
Reference to [Windows.Security.Credentials.PasswordCredential] in PowerShell 7
I want to port an existing PowerShell script written in PowerShell 5.1 to PowerShell 7.1. However it seems I can't create objects of type [Windows.Security.Credentials.PasswordCredential] as the type ...
1
vote
1
answer
560
views
How to get pixel data from VideoMediaFrame.Direct3DSurface?
I creating Unity app for Micorsoft HoloLens 2.
The app captures and shares camera video frames using Windows.Media.Capture.MediaCapture and Microsoft.MixedReality.WebRTC.
I got a VideoMediaFrame....
2
votes
1
answer
752
views
ICompositorDesktopInterop throws exception in TFM .NET 5
I was trying to port a C# code from .NET 4.8 to .NET 5, older version of .NET was using Microsoft.Windows.SDK.Contracts, In .NET 5 Microsoft.Windows.SDK.Contracts is replaced by Target Framework ...
0
votes
0
answers
253
views
Need help figuring out how to code NavigationView pages in WinRT
Let me first state how frustrated I am in not being able to find many examples that are written in C++ for UWP/WinRT. I need to be able to reference and use shared .H files, so C# is not very useful. ...
1
vote
1
answer
800
views
Conversion of Windows.Graphics.Capture.Direct3D11CaptureFrame to OpenCvSharp::Mat
As the title suggests, the aim is to convert Direct3DCaptureFrame from the Windows.Graphics.Capture API to a matrix object available in OpenCvSharp (Mat) so that the captured frame may be used with ...
2
votes
1
answer
1k
views
I want to use windows runtime API in the development of unity's universal windows platform
I would like to use the windows runtime API in the development of unity's universal windows platform.
I made the following script with reference to this site.
#define ENABLE_WINMD_SUPPORT
using ...
1
vote
0
answers
554
views
Get Windows.Storage.StorageFile object without using StorageFile.GetFileFromPathAsync
StorageFile.GetFileFromPathAsync API fails if file is hidden file or a shortcut even if UWP/Win32 app can access to these locations using other APIs (i.e. ...FromApp APIs although they have some ...
1
vote
1
answer
758
views
Do Windows Applications usually have a console for StdIn, StdOut and StdErr
I ran into the following issue using Pascal/FPC/Lazarus, but I think it is universal to all Windows .exe files, regardless of the IDE/compiler they are created with:
I created a Windows GUI ...
0
votes
0
answers
106
views
trying to copy pixal data from cpu to gpu using map every thing runs fine but the screen comes empty directx
in my TextureHendler class, I create an empty texture using this
D3D11_TEXTURE2D_DESC textureDesc = { 0 };
textureDesc.Width = textureWidth;
textureDesc.Height = textureHeight;
textureDesc.Format = ...
1
vote
1
answer
3k
views
WinRT initialization error, hresult_error at memory location
I am unable to initialize WinRT/C++ with wxWidgets.
WinRT/C++ works nicely until I add wxWidgets support, here is the code:
class MyApp : public wxApp {
public:
virtual bool OnInit();
};
...
0
votes
1
answer
375
views
How to include System in C++/WinRT console application
Using Visual Studio 2019 16.10.2 how do you include .NET components in a C++ / WinRT Console programme?
The indexOf method of IVector requires a UInt32 struct from System.
How is the System utilised ...
0
votes
0
answers
431
views
FromBluetoothAddressAsync function return null
Sometimes FromBluetoothAddressAsync() from WinRT returns NULL:
BluetoothLEDevice::FromBluetoothAddressAsync(deviceAddr).get();
Thats depends by deviceAddr, thats mean that function for some of ...
2
votes
1
answer
2k
views
Library includes WinRT brocken [closed]
I am trying to compile this project: https://github.com/bucienator/ble-win-cpp
After cloning the repository, I got the error "wait_for" is not a member of "winrt :: impl". Using ...
1
vote
1
answer
1k
views
WinRT too many errors in base.h
I am using Visual Studio and trying to compile simple WinRT example:
pch.h:
// pch.h
#pragma once
#include <Windows.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/...
0
votes
1
answer
775
views
How can you `co_await` in a C++/WinRT lambda?
Can you co_await in a C++/WinRT TimerElapsedHandler (or any other lambda in C++/WinRT)?
When I try to compile code like this:
auto pointerExitedTimerHandler = winrt::TimerElapsedHandler([](const winrt:...
0
votes
0
answers
147
views
StartTerminateAsync throws TYPE_E_ELEMENTNOTFOUND
I'm trying to kill a UWP application from its AUMID using the StartTerminateAsync method, however it's throwing an error:
"Element not found. (0x8002802B (TYPE_E_ELEMENTNOTFOUND))"
This is ...
0
votes
1
answer
49
views
Does the Windows Store prevent app DLLs from changing maliciously?
If I change any DLL of my UWP app that I purchased from the Windows Store, will the app crash if it runs?
If not, what can I do to prevent attacks on my application through DLL?
0
votes
0
answers
407
views
WinRT CoInitialize in Python
I have the following simple code:
import winrt.windows.applicationmodel.datatransfer as DataTransfer
clipboard = DataTransfer.Clipboard
print(clipboard.clear())
And am getting this error, any idea ...
2
votes
1
answer
2k
views
Making a simple message box using C++/WinRT
I'm having trouble making a simple message dialog in C++/WinRT. Something as simple as "You clicked this: press ok to continue" nothing fancy. In the standard Windows API you can simply ...
1
vote
2
answers
1k
views
Proper way to create a WinRT object in C
Does anyone know what is the proper way to create a WinRT object in C?
I'm trying to convert my C++ code that uses WinRT API to plain C code.
And right now I'm able to get a few WinRT static functions ...
3
votes
1
answer
327
views
.net5 windows api calls with CSWinRT
I am using the Windows.Devices.Bluetooth library in a WPF application using the .net 5.0 framework.
I have referenced the windows api by installing the CSWinRT nuget and using the target framework ...
1
vote
0
answers
108
views
What is powershell syntax doing something like Assembly::LoadWithPartialName?
I found this piece of code over Internet. And it works
[void][Windows.Networking.Connectivity.NetworkInformation, Windows, ContentType = WindowsRuntime]
[Windows.Networking.Connectivity....
1
vote
0
answers
591
views
How to call WinRT from MAUI code-behind in the right thread?
I am trying to use a GraphicsCapturePicker from the code-behind in a MAUI app and am hitting a COM exception implying I am calling this from the wrong thread. Typically code in WPF/XAML code-behind ...
2
votes
0
answers
218
views
How are WinRT / .net exceptions raised from C++/WinRT?
I've been trying to wrap regular C++ exceptions in .NET-style exceptions that can be caught from the C# code using a C++/WinRT library, to allow it to receive errors from the wrapped C++ library.
This ...
0
votes
1
answer
190
views
Check if folder pointed by StorageFolder still exist
How can I check if a folder pointed by a StorageFolder still exist?
1
vote
1
answer
189
views
Ambigious call to overloaded function when using lambda
Never used lambdas before and I can't understand where I'd have to add it.
My Error is "Show: Ambigious call to overloaded function"
Show() can take 2 types CustomizeToast and ...
3
votes
1
answer
411
views
How to get button events and text input from a python winrt toast?
How can I get the code to call a function when a button is pressed, and get input from a textbox from a pywinrt toast?
I am making a python library that can make windows toast notifications easier to ...
0
votes
2
answers
210
views
Run out of process background task as administrator
I'm currently working on a UWP app that has an out-of-process background task (in a windows runtime component project). In the background task I'm trying to run a trace event session from the ...
1
vote
0
answers
115
views
File sharing token retrieval using SharedStorageAccessManager.AddFile fails for temporary files
I am writing an UWP application. I am trying to generate a file sharing token for an email attachment opened with my App. However, this is raising an exception "Access denied"
//App.xaml
...