Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

C++ component in WPF App

$
0
0

Hi, I found this article by Scott Hanselman
http://www.hanselman.com/blog/HowToCallWinRTAPIsInWindows8FromCDesktopApplicationsWinRTDiagram.aspx

Which explain how to call WinRT componet in WPF app.

I then tried to create an UWP component with VS2015 and simply tried to instantiate it in a WPF app.

I copied that settings in my WPF project .csproj

<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion><TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>

I referenced my UWP component in the project. I got an exclamation mark on my reference but no clue as to what is the problem.

Intellisense in VS knows the component and give me syntax completion.

At runtime I got the following error:

An unhandled exception of type 'System.TypeLoadException' occurred in WpfD3D11Interop.exe

Additional information: Could not find Windows Runtime type 'VisualizationComponent.Class1'.

with the InnerException message:

Types from custom Windows Runtime components are not supported in desktop applications.

Any workaround?
I would like to mix and match WPF (in C#) with DirectX (in a D3DImage), as a component easily accessible in .NET, any tips?

Is C++/CLI my only solution? (for ease of interop)


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>