combine c++ and c#
Hi everybody,
I wish to know, if it's possible to combine c++ and c#.
I mean, if I create a DirectX device using c++, could I draw it in a c# window.
I'm not so confortable with c# and I 'd like to develop a 3D modeler based on c++ with an c# interface (I suppose the easiest way to create fancy user interface).
Thanks for your help
You can develelop you code in C++ and then expose it to C# as library using managed C++. Otherwise you can make you C++ code to be ActiveX control and use it from C# as such, yet another way is to make C++ dll with exported functions and then call the funtions from C# using dllimport attribute (just search the internet for examples and you will find thouthands of them).
My guess would be that the fastest solution (in terms of performance) will be to use managed C++ library (the first one). But managed C++ is very very complicated to use, it will be much more painfull than just to learn C#. Actually I think that you should not underestimate performace of C#, I think that in most cases it will not be easy to make faster code with C++ than C#.
Anyway here is an article on performace consideration when connecting native code and .NET:
http://msdn2.microsoft.com/en-us/library/ky8kkddw.aspx