What is the difference between Managed C++ and C++/CLI?
What is exactly the difference between the "old" Managed C++ and the "new" 开发者_StackOverflow中文版C++/CLI?
Managed C++ is the version in VS2002 and VS2003. It had race conditions and other serious bugs, as well as being confusing. It's no longer supported.
In VS2005, Microsoft introduced C++/CLI, which has also been accepted as an ISO standard. It's also supported in VS2008 and the upcoming VS2010.
Both of them had the same goal, which is to create .NET assemblies using the C++ language. The syntax is different (C++/CLI managed code is a lot easier to differentiate from standard C++ at a glance) and C++/CLI also has syntax for .NET 2.0 features such as generics.
http://msdn.microsoft.com/en-us/library/ms235298.aspx gives a rough overview of the syntax changes.
Managed C++ (Managed Extensions for C++) is a set of microsoft specific keywords used with standard C++ syntax to allow compile managed code. IT was designed such that programmers could start using .NET as fast as possible and made porting native code to .NET platform very easy. It used IJW (it just works) priciple, which made programming porting to .NET easier, but it also had lot of flaws.
C++/CLI is a new language. It solved lot of problems of Managed C++, made .NET programming more powerful and is accepted as standard, but also introduces new syntax, new keywords, and is more more different from unmanaged C++ than older Managed C++.
精彩评论