Questions tagged [winrt-component]

Windows Runtime Component and WinRT Component Libraries are concepts related to language runtime interoperability in Windows Runtime - the modern development platform for Windows and typically used in Windows Store applications. Use this tag to denote any questions related to creating WinRT Components, WinRT Component Libraries and typically to limitations imposed by the rules of creating WinRT Components.

From Wikipedia:

Classes that are compiled to target the WinRT are called WinRT components. They are classes that can be written in any supported language and for any supported platform. The key is the metadata. This metadata makes it possible to interface with the component from any other WinRT language. The runtime requires WinRT components that are built with .NET Framework to use the defined interface types or .NET type interfaces, which automatically map to the first named. Inheritance is as yet not supported in managed WinRT components, except for XAML classes.

Windows Runtime applications can be written using any combinations of the three major runtimes - native, .NET and JS as long as these components are exposed across ABI (application binary interface) following rules such as - public classes need to be sealed, method arguments and return types need to be WinRT types themselves or have direct projection to those (such as Windows.Foundation.Uri with System.Uri or Platform::String and System.String or many of the other basic types having counterparts in different language runtimes).

114 questions
2
votes
1 answer

How to convert from float3 to C++/WinRT type?

I'm writing a custom C++/WinRT component which will be consumed from a C# application. Inside this component I have objects that I need to expose to the caller application and these objects have properties, in this case an Id and a Position. The Id…
2
votes
0 answers

Unable to pass byte array from UWP C# Component to WinRT C++ component

I'm trying to render image data in the WinRT C++ component, so I'm passing a byte array from the UWP component to the WinRT component. But IDL Doesn't support Byte* StreamSamplePool.cpp void StreamSamplePool::HandleFrameData(BYTE*…
2
votes
1 answer

Registering to MediaStreamSample Processed event gives 'H': is not a legal base class error

I'm trying to subscribe to MediaStreamSample Processed event, so when ever processed event is triggered OnSampleProcessed method must be triggered Below implementation is what I have tried StreamSamplePool.h void…
2
votes
1 answer

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 C++/WinRT Console Template app, BUT I can't seem…
Thomas T
  • 59
  • 6
2
votes
1 answer

Public ref class implementing internal interface in C++/CX

I have a Windows Runtime component in which all of my classes need to expose a handle internally: private interface class IHandleContainer { IntPtr GetHandle(); } namespace Foo { public ref class Bar: IHandleContainer { ... } public ref…
Rob
  • 3,276
  • 2
  • 22
  • 25
2
votes
1 answer

How to make audio player that written my own can run in background (Windows Phone 8.1- WinRT)?

I've developed an audio player that use decoder library, so now I don't know how to make it can run in background. I've read 'background audio overview for windows phone' but it is for system player default. so how can do this for my own audio…
2
votes
0 answers

Alternative for InternetSetOption in winRT

Is there any alternative to Set/Get proxy settings in winRT. I need to implement this for a windows store App. I found this link (https://msdn.microsoft.com/en-us/library/windows/apps/hh464945.aspx?f=255&MSPPError=-2147217396 ) but there is nothing…
2
votes
1 answer

Copy Constructor for c++/cx ref class having native C++ pointer.

I have a C++/CX ref class that contains a pointer of an un-managed C++ class. The ref class don't need any copy constructor because they are managed by reference buy should I need to write the copy constructor of the ref class in this case to avoid…
AIK
  • 39
  • 5
2
votes
2 answers

How to use SQLite in both Windows Phone 8.1 Silverlight Application and WinRT Runtime Component

I have a situation where I have a Windows Phone Silverlight 8.1 application, and I would like to use a Windows Runtime Component as a background task. In both of these projects, I want to use SQLite for accessing the applications database. I have…
2
votes
0 answers

How to make property editable in PropertyGrid?

I'm developing a custom control for Windows Store App. This control has a property of type MyPoint: public static readonly DependencyProperty CenterPointProperty = DependencyProperty.Register("CenterPoint", typeof(MyPoint),…
2
votes
1 answer

C4827 warning overriding ToString in C++/CX Metro class

I have a C++/CX Windows Store component class and I'd like to implement a custom public ToString method that I can invoke from C#. It compiles fine but I'm getting an odd warning from the compiler. Here is code that reproduces the warning: public…
1
vote
2 answers

How to consume WinRT component inside Win32 dll project?

Using Registration-free WinRT it is possible to load WinRT components inside Win32 application. What's the process to load WinRT component from inside Win32 dll? I tried the steps mentioned as part of Win32, but winmd files are not generating the…
1
vote
0 answers

Dynamic C++/WinRT dll loading in Win32 apps

For the past couple of days, I've been trying to learn WinRT, working with the manifests, loading the C++ or C# DLLs, etc. The next logical step for me was to try to build a plugin system that loads my WinRT DLLs that can be written in C++ or C#…
Adrian Z.
  • 904
  • 1
  • 12
  • 29
1
vote
1 answer

WinRT C++ component with non primitive function return types fails to compile/build

The below program works fine while having functions with primitive return type functions specifically the Pop function defined below works and I'm able to build properly, but when I build the solution with a function having non primitive return type…
Prithvi Venu
  • 264
  • 3
  • 16
1
vote
1 answer

How to iterate IMapView WinRT object within Javascript UWP application?

i have a need to iterate the WinRT type of object in order to unregister a UWP background task which i have registered with success. I have access to this object BackgroundTaskRegistration.AllTasks in javascript but i receive a WinRT collection of…
Tim
  • 177
  • 2
  • 13