Ingerdev
Ingerdev

Reputation: 89

Calling UWP C# code from UWP c++/cx

I have an UWP C++/cx application and UWP C# class library.
How can i use classes from c# library in c++ project?

Any suggestions?

P.S.
I cannot have "c# proxy app", my app is of type c++/cx.

Upvotes: 3

Views: 1285

Answers (2)

Matt Hargett
Matt Hargett

Reputation: 1984

For a great example of how to do this, check out how ChakraBridge C++/CX project in React Native Windows is used: https://github.com/Microsoft/react-native-windows/tree/master/ReactWindows/ChakraBridge

C# calls into C++/CX and then back out, totally transparently, living up to the cross-language workflow the CLR allows. There's also a pull request in React Native Windows that shows how to add a few compile-time directives that allows for sharing C++/CX and C++/CLI code: https://github.com/Microsoft/react-native-windows/pull/769/

Upvotes: 0

Ingerdev
Ingerdev

Reputation: 89

Standart uwp c# classlibrary is invisible for c++/cx.
Proxy library "windows runtime component" should be created and added to c++ class.

Upvotes: 1

Related Questions