The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

uj.. (2) [Avatar] Offline
#1
I've come to like C++/CLI. I know C++/CLI is promoted as an interop specialist and C# as THE language for general .NET applications. For example Visual C++ won't have direct support for WPF programming.

My program is a molecular dynamics application. There will be a "3D window" where molecules with be shown and interacted with by the user. I will use Direct3D for this. There will also be a heavy floating point "calculation engine" where the positions of the molecules will be continously calculated. I'm planning to use WPF for the general GUI to have maximum flexibility.

Now I have three major development strategies:

1. To code everything in native C++/CLI and interop with managed parts such as WPF.

2. Code the major part in managed C++/CLI. The XAML WPF part is included as managed libraries developed in Visual C#. The "calculation engine" is in native C++ and interopted from managed C++/CLI. Same with the "3D window".

3. Same as 2 above but instead of C++/CLI use C# for the major part of the application.

The 1'st option would make most of the application source level portable. With 2 and 3 I miss out on that but because my main target is Windows it's maybe not that important and using managed code is more productive.

It's the choise between 2 and 3 that gives me the biggest headache. Could you please elaboare a little on the relative advantages of betting the application on C++/CLI or go the more safer route and use C# (with C++/CLI for interopting with native C++ only). What do you think?

Thank you.
uj.. (2) [Avatar] Offline
#2
Re: Advice
I would like to add that I haven't discarded option 1. The idea of portability is quite appealing. There's also a 1b option and that's to use managed C++/CLI but restrict the code to the ISO C++ part only (except of course when managed .NET libraries such as WPF are accessed). Would it be possible to use a C++ library like Boost in such a scenario? I mean compile it to managed ISO C++ and would that be an advantage over using native Boost?
Nish (16) [Avatar] Offline
#3
Re: Advice
Hello UJ,

I'd probably use C# for the major portions of the application and use C++/CLI to do the interop portions alone.