I am wondering when I would use c++ in managed versus unmanaged mode?
Are there speed advantages with one mode over the other? Is it easier to access 3rd party libraries in one mode over the other? Are there any installation issues to worry about?
I am wondering when I would use c++ in managed versus unmanaged mode?
Are there speed advantages with one mode over the other? Is it easier to access 3rd party libraries in one mode over the other? Are there any installation issues to worry about?
I find that managed mode (C++/CLI) is primarily useful as a gateway facility that allows you to leverage legacy libraries. In short, I used it when I have to program in .Net, but need access to a C++ code base.
On its own, there's very little reason to choose C++/CLI over C#, which is cleaner, more modern, better-supported by the IDE and a gazillion tools (ReSharper, for instance), and can even do occasional low-level stuff via the unsafe keyword.
C++/CLI has been touted by its designers as the most powerful .Net language (largely because of the seamless legacy bridge and true RAII semantics for .Net objects), but it hasn't gotten much traction in the .Net community.
The only reason to use "managed" mode in C++ (which, in the current versions, is C++/CLI) is to access .NET libraries. In order to use the .NET Framework, or interoperate cleanly with .NET languages, you'll want to target the managed API.
This is useful for creating a bridge between native and managed code, but also can be used for managed development, or to use .NET libraries within a C++ project.