Jump to content

Managed C++

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 66.23.192.42 (talk) at 00:10, 3 October 2004 (Derrick Coetzee - Robot-assisted disambiguation: Automatic garbage collection). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Managed C++ is one of Microsoft's new languages for their .NET initiative. Officially it is called Managed Extensions for C++ by Microsoft, but it is almost universally referred to it by its shortened form.

Managed C++ is not a language unto itself, but, as its official name implies, extensions to the C++ language. It adds special syntax additions to the language that make the application managed. That is, applications written in Managed C++ have automatic garbage collection and will run via the .NET virtual machine, just as applications written in C# and Visual Basic .NET do. Additionally, applications written in Managed C++ compile to CIL—Common Intermediate Language—and not directly to native CPU instructions like regular C++ applications do.

Managed C++ occupies a unique position in the gallery of .NET languages. It is the only language that can communicate natively with .NET languages (such as C#, VB.NET) and native C++. The other .NET languages can only communicate with C++ code via COM, a rather slow and inefficient method. But since Managed C++ can communicate directly with both languages, it is often used as a "bridge" between the two languages. Therefore, it is often used to write wrappers for C# or C++ code bases which wish to communicate.