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: 98
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: 3923
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: 3
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: 3923
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.
 
decai
Posts: 54
Joined: 06 Jul 2016, 18:19

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

28 Jan 2021, 10:43

Hi,

Is that possible provide a Swift SDK, that GUI use Swift and App logic use C++?
 
User avatar
jsantos
Site Admin
Posts: 3923
Joined: 20 Jan 2012, 17:18
Contact:

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

28 Jan 2021, 11:17

Yes, I am sure it is possible although it is not an easy task. You should proceed similar to C#, and create a layer on top on C++ using Swift. For C# we are using SWIG.
 
decai
Posts: 54
Joined: 06 Jul 2016, 18:19

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

28 Jan 2021, 12:34

Create Swift Noesis SDK is easy?
 
User avatar
jsantos
Site Admin
Posts: 3923
Joined: 20 Jan 2012, 17:18
Contact:

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

28 Jan 2021, 13:58

It is not an easy task but as said before it it possible doing the same we are doing for C#

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 22 guests