user316117
user316117

Reputation: 8271

Confused about Microsoft C++ offerings and terminology

I'm using C++ for the first time since pre-.Net days and I'm confused about some of their C++ offerings and how they name them.

Prior to .Net, Microsoft supported a language called C++ which was pretty close to the industry standard. But when they introduced .Net they add a lot of extensions to their C++ and called it "Managed C++".

Then in 2005 they dropped that and replaced in with "C++/CLI" which is a version of C++ that conforms to Microsoft's (ISO-certified) Common Language Infrastructure and has some syntax changes (e.g., ^ instead of * for pointing to .Net objects, etc). C++/CLI can be compiled down to the platform-neutral Common Intermediate Language (CIL). At runtime this is processed into machine code by the Common Language Runtime (CLR). Here's a diagram from Wikipedia: http://en.wikipedia.org/wiki/File:Overview_of_the_Common_Language_Infrastructure.svg

Here's where I get confused: In Visual Studio 2010 Professional I don't see the term "C++/CLI" anywhere, even though that is supposedly what Microsoft is offering. If I do File->New->Project->Other Languages it lets me select "Visual C++"

1. What is "Visual C++" and how does it relate to C++/CLI?

At the top level of "Visual C++" it lets me create an "Empty Project" and in the Project Properties for it, Common Language Runtime is set to "No Common Language Runtime Support"

2. Does "No Common Language Runtime Support" also mean no CLI/CIL and thus no C++/CLI syntax? In other words does the state of that setting determine whether this is "C++/CLI" or just plain old unmanaged C++?

Underneath "Visual C++" it also has entries for CLR and General. If I make a CLR Empty project I notice that Common Language Runtime is set to "Common Language Runtime Support /clr"

3. Is that the only difference between a Visual C++ empty project and a Visual C++ CLR empty project?

4. What is a Visual C++ "General" empty project?

5. Is all this stuff documented/explained somewhere?

EDIT: Since posting my question I've noticed that it's even more complicated. The default properties for Common Language Runtime vary on different templates under the CLR node from CLR to CLR with "Pure" MSIL to CLR with "Safe" MSIL. And that's just that one "Common Language Runtime" setting. Does Microsoft document these templates anyplace?

Upvotes: 2

Views: 706

Answers (2)

Daniel Daranas
Daniel Daranas

Reputation: 22624

The Wikipedia article on Microsoft Visual Studio says:

Microsoft Visual C++ is Microsoft's implementation of the C and C++ compiler and associated languages-services and specific tools for integration with the Visual Studio IDE. It can compile either in C mode or C++ mode. For C, it follows the ISO C standard with parts of C99 specification along with MS-specific additions in the form of libraries. For C++, it follows the ANSI C++ specification along with a few C++11 features. It also supports the C++/CLI specification to write managed code, as well as mixed-mode code (a mix of native and managed code). Microsoft positions Visual C++ for development in native code or in code that contains both native as well as managed components. Visual C++ supports COM as well as the MFC library. For MFC development, it provides a set of wizards for creating and customizing MFC boilerplate code, and creating GUI applications using MFC. Visual C++ can also use the Visual Studio forms designer to design UI graphically. Visual C++ can also be used with the Windows API. It also supports the use of intrinsic functions, which are functions recognized by the compiler itself and not implemented as a library. Intrinsic functions are used to expose the SSE instruction set of modern CPUs. Visual C++ also includes the OpenMP (version 2.0) specification.

So, I can have a go at answering your questions (which, by the way, are too broad):

  1. Microsoft Visual C++ (often abbreviated as MSVC or VC++) is a commercial (free version available), integrated development environment (IDE) product from Microsoft for the C, C++, and C++/CLI programming languages. It features tools for developing and debugging C++ code, especially code written for the Microsoft Windows API, the DirectX API, and the Microsoft .NET Framework.
  2. I'd say yes.
  3. I'd say yes, but that is a big difference in itself, even if it is the only one.
  4. I don't know exactly. I guess an empty project is a project which is designed so that you add your own stuff to it. "General" probably means that the project is not of any specific kind.
  5. Microsoft has tons of documentation on MSDN, but has a long tradition in confusing people between the real C++ and their own managed C++-ish language, whatever they call it today. (I have always thought that this is bad, because C++ is C++ and there are lots of names out there for your new language, and that they've done it on purpose to gain clueless users. But this last sentence is an opinion, so it doesn't belong here. Hence the brackets.)

Upvotes: 1

Vlad from Moscow
Vlad from Moscow

Reputation: 310920

  1. Does "No Common Language Runtime Support" also mean no CLI/CIL and thus no C++/CLI syntax? In other words does the state of that setting determine whether this is "C++/CLI" or just plain old unmanaged C++?

Yes it means.

When you select "Create a new project" you can select (something as) "CLR Console Application" It means C++/CLI console application.

Also you can create Managed C++ console application if in the project properties you select option as

(something as) "CLR-support, old syntax (/clr:oldSyntax)" (I have Russian edition of MS VS 2010)

Upvotes: 0

Related Questions