Programmable IDE
There’s little doubt that the new Visual Studio IDE is flexible. You can do everything from
customizing the toolbars to changing the entire look of the IDE using command line
switches. It’s hard to imagine that you could make the IDE any better than it is right now.
Every developer can have an IDE that matches their programming style and usage needs.
Visual C++ has supported the use of macros for several versions now. However, in this
version you’ll find that macro support has increased. You have full control over every aspect
of the programming environment and can even create extensions to that environment using
a simple macro command. This added functionality makes it possible to create an IDE that
Microsoft didn’t envision—one that includes tools that you or your company develops.
However, the true programmability of the Visual Studio.NET IDE becomes apparent when
you look in the Extensibility Projects folder of the New Projects dialog box. There you’ll find
two new entries. The first allows you to create shared add-ins, while the second allows you
to create Visual Studio.NET Add-Ins. I can foresee a brisk business in third party add-ons for
Visual Studio.NET developing. Eventually, you may find that the IDE you get from Microsoft
doesn’t resemble the one you use for creating applications at all.
Attributed Programming
Visual C++ .NET is going to be an entirely new programming environment in a lot of ways.
Everyone is going to get some new features to play with and find new ways to create
applications faster. One of the more exciting changes for ATL programmers is the addition of
attributed programming. Attributes tell the compiler what you’d like to do with your code in a
given circumstance, which greatly reduces the amount of descriptive code you have to
create. For example, you may want to create an event source, so you’d use the
event_source attribute to do it. The compiler automatically generates all of the required
“boiler plate” code for you based on the event source description you provide in your code as
part of the normal development process. In some cases, you’ll be able to get rid of those IDL
files that you’ve had to maintain all of these years.
Note
Attributed programming is a complex topic that will require substantial
coverage to understand. I’m giving you the 50,000-foot level view of
attributed programming in this chapter. We’ll talk more about attributed
programming in Chapter 13.
So, why is this feature so important? Imagine writing the components you always have in the
past, but with as little as 25 percent of the code you use today. Less code means fewer
potential errors and a shorter development time. Programmers from all walks are finding
they have a hard time meeting delivery dates, given shortened deadlines and increasing
application complexity. Any technology that promises to reduce development time using a
tool that you’re already familiar with is a welcome relief. Attributed programming promises to
reduce development time by an order of magnitude.
Managed Environment
Visual C++ .NET will actually support two completely different application execution
environments: managed and unmanaged. A managed environment is one where a
framework, in this case the .NET Framework, manages the application. The framework
controls everything from how the application creates objects to the way it allocates memory.
An application talks to the framework, which determines if it can fulfill the request, and then
the framework talks to the Windows API to complete the request. The addition of the .NET