This project is read-only.

Use C# GUI from C++ ?

Jan 18, 2008 at 10:17 AM
I'm a C++ programmer but I see in C# many advantages. I'd like to use C# for example for creating my application frontend (complex GUI...). However my main project would stay C++.
Can I use CrossNet to access C# objects (GUI classes based on .NET components) from C++ ?
I'd like to write GUI code on C#, convert it to C++ and use these objects from my pure C++ project ?
Thanks for your time

Jan 18, 2008 at 12:14 PM
I'm strongly recomend you to change your architecture. Turn your C++ code into library and create DLL. Now you can write your frontend using regular .NET CLR and invoke this DLL
Jan 19, 2008 at 6:25 AM
Correct, it may be better to use p/invoke in your case (the C# code driving C++ backend, which is the other way around).

Note that you could change CrossNet to generate wrappers for you (managed-wrapper to be used my unmanaged C++ code), although it should not be extremely complicated, that would be more painful than the p/invokes.