Karen
Topic Author
Posts: 1
Joined: 05 Feb 2015, 16:29

Native C++ program using C# code behind ???

19 Mar 2015, 18:01

I'm developing a native C++ program using DirectX11 to show live video on a Windows 8.1 PC.
I know it would be possible to use xaml and C++ code behind to build the UI for the program.

Your documentation shows that it is much simpler to use C#, rather than C++, for the code behind.
So I was wondering if this is possible to do in my native C++ program - or makes any sense.

The C++ program would need to be able to make calls to the data model class, and access its Properties. It would also want to handle events from the user control class.
Would this require the use of a managed C++/CLR dll to access the members of the C# data model and user control classes?
 
darthmaule2
Posts: 94
Joined: 23 Oct 2014, 19:54

Re: Native C++ program using C# code behind ???

20 Mar 2015, 14:03

It does seem simpler to use C# code behind.
Can this be done from a C++ application?
 
User avatar
jsantos
Site Admin
Posts: 2905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Native C++ program using C# code behind ???

24 Mar 2015, 12:49

Unfortunately, there is no way (officially) to mix C++ and C# in the same application. The SDKs are not compatible. I imagine that, under Windows at least, C++/CLR could be used to use the C# API, although we didn't try it out. Another alternative would be supporting an embedded mono virtual machine.

Definitely this is something we should investigate in the future because the C# API is a lot simpler to use.
 
davjs
Posts: 1
Joined: 07 Sep 2020, 14:45

Re: Native C++ program using C# code behind ???

07 Sep 2020, 15:45

Would love a mono vm to run all UI code and non game related code in!
 
User avatar
jsantos
Site Admin
Posts: 2905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Native C++ program using C# code behind ???

09 Sep 2020, 16:52

A few clients with access to source code are doing that, using C++ and C# simultaneously in the same project. It is a bit tricky to setup and for now we don't have immediate plans to expose this in our official SDKs.

Who is online

Users browsing this forum: No registered users and 1 guest