WindowsDevCenter.com
oreilly.comSafari Books Online.Conferences.

advertisement


AddThis Social Bookmark Button

Visual C++ 7 Unveiled

by John Osborn
04/01/2000

At 2 AM there was a sudden whoop from the fire alarm in my hotel room, followed by a voice gravely announcing that a fire emergency had been declared and that we were to "leave the building" until its cause was found. It was a dramatic start to the west coast edition of the Visual C++ Developer's Conference, which I had decided to attend at the expense of my beloved Patriot's Day weekend back in Massachusetts. As I listened to the first public preview of Visual C++ 7 the following morning, somewhat dazed from the nighttime evacuation, I found myself wondering whether the alarm might have some deeper symbolic meaning.

One imagines many alarms at Microsoft these days, but such concerns seemed remote to the more than 500 hardcore C++ developers and a large contingent from the Redmond VC++ team who had gathered in Santa Clara, CA. The three-day Visual C++ Developers Conference was recently acquired by Fawcette Technical Publications, which also publishes the Visual C++ Developer's Journal, and is held each year at locations on the east and west coasts of the United States. There were more than 50 sessions on the schedule conducted by a number of well-known teachers and authors including Richard Hale Shaw, Jeff Prosise, Dr. Richard Grimes, as well as lead developers on the Microsoft Visual C++ team. A tradeshow on the second floor of the hotel gave attendees an opportunity to kick the tires of third-party Visual Studio products.

My own schedule gave me only enough time to drop in on Day 1 of the event. The keynote by Tony Goodhew, Visual C++ product manager, and Craig Symonds, General Manager of Developer Tools, was well attended, as was the "Ask the Visual C++ Developer" session that evening. Attendance at other sessions during the day seemed balanced, but those devoted to the Active Template Library and the new "attributes" being added to Visual C++ 7 were packed. During the day I had a chance to interview Goodhew and Bill Dunlap, lead product manager for Visual Studio 7. A summary of our conversation will appear later on oreilly.com.

So what can Visual C++ developers expect? First, there is nothing new to report about release dates. A beta still appears likely mid-year with final product sometime in 2001. There is likely to be at least one more service pack before that release in order to keep up with changes on other fronts, such as a new version of ADO and OLE DB coincident with the release of SQL Server 2000.

Aside from dates, however, here are four major areas to watch as Visual C++ emerges from the Microsoft tools group over the next few months: IDE unification, attributes, ATL Server, and web services.

A unified interactive developer environment (IDE), the face that Visual Studio presents to programmers, is something that users have wanted since its very first release. Visual Basic, Visual C++, Visual J++, and Visual InterDev all ship with Visual Studio 6, but only the latter two products share a common IDE. This balkanization will finally end in VS7. The entire IDE has been rewritten. For the first time, developers will be able to construct projects using one or more of the languages in the Visual Studio suite. A cool new interactive help facility provides context sensitive advice that changes as the programmer types code. And the IDE will include language independent visual tools that can be accessed from any language for writing HTML, XML, data access and server side code, though none of these was demonstrated at the conference. The product looked sweet in the demo, and in the evening Q&A session the UI team promised a greatly extended object model that would encourage third-party developers and IT managers to link supporting applications to the development environment.

For Visual C++ programmers, the most interesting enhancement is the ability to use "attributes," IDL-like specifications, to simplify a variety of programming tasks. Also new is a greatly expanded Active Template Library, including a subset called ATL Server for programming high performance IIS 5.0 and web-based applications.

Attributes are likely to be controversial within the C++ community at large. Their syntax is, for all practical purposes, identical to the syntax of IDL, the interface definition language that COM developers use today to define COM interfaces. Experienced developers will find the square brackets that set off such keywords as [object] and [uuid] to be as familiar as the keywords themselves. Also familiar are a small number of "double underscore" keywords, such as __interface, that have been part of IDL (without underscores) for years. What is genuinely new is the addition of attribute keywords and syntax for tasks other than COM programming. The list previewed at the Visual C++ Developers Conference included attributes for registry, data access, performance monitoring and server-side programming.

There is more to be written about attributes, and we will do so in future articles. Should we regard them as yet another attempt by Microsoft to embrace and extend an established language? Microsoft would say no. First of all, attributes and the new "double underscore" keywords are used only in Visual C++ code destined to be executed on Microsoft platforms. The attributes announced thus far simplify tasks that are unique to the Windows DNA environment and they consolidate code that now requires separate steps, such as creating a COM component, generating a uuid and registering it.

Secondly, attributes more closely resemble macros or compiler directives than true language extensions. In fact, as demonstrated by Microsoft developer Sridhar Madhugiri in his talk on Attribute-Based Programming with COM+, when the Visual C++ compiler encounters an attribute it replaces the statement with standard C/C++ code before generating and linking final object code. The "__interface" keyword, for example is defined as a C++ struct. This is no different than the way in which the current Microsoft IDL (MIDL) compiler prepares IDL files for execution. Programmers can examine and modify the C++ code injected into their sources before completing their final builds. Microsoft spokespersons say that by deliberately not extending C++, they have simplified difficult Windows programming tasks while preserving the flexibility of C++ that programmers value.

I did find myself wondering whether attributes were a symptom of yet another problem, namely the inability of Microsoft to extend Java, clearly a more suitable language for OOP, due to its continuing court case with Sun. I also wondered what we might see in Visual Basic, as it too receives an OOP upgrade of its own. But these questions will have to be set aside as we await the beta and further announcements from Microsoft.

In addition to attributes, ATL Server and new support for exposing applications as SOAP-enabled web services figure prominently in plans for Visual C++ 7. For a peek at both features, check out the announcement at Microsoft Developer Network. Contrary to earlier announcements, it is now clear that Visual C++ developers will have a complete set of tools for creating high performance web applications. Visual Basic will continue to get star billing as the tool that is the easiest to use and the most productive in the suite, but C++ developers will not be left out in the cold.

In the weeks ahead, we at O'Reilly will be working on our own plans for definitive titles that help Visual C++ programmers make the move to the new world of Version 7. What would you like to see? How could we be most helpful? Please write.

As for the late-night fire alarm, our trek downstairs ended in the lobby, where the hotel manager pointed us to empty elevators poised to whisk us back to our beds. Outside, sleek neon-green Santa Clara fire trucks purred in the early morning drizzle as firemen prowled the lobby. There was no fire, but everyone who needed to be on the case was right there.

John Osborn is a senior editor with O'Reilly Media, Inc., responsible for Windows and .NET developer books, PDFs and other content.