Click Here to Install Silverlight*
United StatesChange|All Microsoft Sites
MSDN
|Developer Centers|Library|Downloads|Code Center|Subscriptions|MSDN Worldwide
Search for


Advanced Search
MSDN Home > MSJ > May 1997
May 1997


Introducing Visual Studio 97: A Well-stocked Toolbox for Building Distributed Apps

Mary Kirtland

Visual Studio targets developers of distributed, client-server Web applications. It provides all the tools you need to create and maintain each tier of the multitier application architecture. Many of the improvements are aimed at simplifying the creation or use of ActiveX components.

This article assumes you're familiar with C++, The Internet, OLE

Mary Kirtland is a Program Manager in the Microsoft Developer Support Internet and Components Group working with OLE/COM and ActiveX technologies.

When I was a kid, my dad earned a living as a cabinetmaker. He had a whole shop full of tools. Watching him, I learned that picking the right tools for a job was important. Using a tool the wrong way could end up with the tool broken or the thing I was fixing in even worse shape than when I started.
As a software developer, I often find myself with a limited set of tools and a job that needs to be done yesterday. Instead of finding the right tool for the job, I often make do with the tools I have. Sometimes using the wrong tool for the job means it takes a little longer or I have to work a little harder. Other times, using the wrong tool dooms the project.

Visual Studio 97 to the Rescue

Microsoft® Visual Studio™ 97 goes a long way toward providing you with a well-stocked toolbox to help you complete your development projects. Visual Studio targets developers and teams that create dynamic Web-based applications or other distributed applications. Visual Studio takes all of Microsoft's development tools, adds a rich set of new tools for creating Web content, and ties it all together with comprehensive documentation. Even if you're not creating distributed applications but you use two or more Microsoft developer products, you'll probably find Visual Studio suits you. (If you use only one tool, don't stop reading—each of the tools in Visual Studio is also available separately. And you might find another tool that would make your life easier.)
In this article, I'll give you a quick overview of what Visual Studio is all about. It's a big product, so don't expect every detail of every tool to be covered here. I'm going to focus on the new tools released for the first time in Visual Studio and the new features of tools you've probably seen before. Watch Microsoft Systems Journal and Microsoft Interactive Developer (MIND) for more in-depth articles about individual tools.

Why Visual Studio?

Visual Studio specifically targets developers of distributed, client-server Web applications (see the sidebar, Building Distributed Applications with Components). It provides all the tools you need to create and maintain each tier of the multitier application architecture. Many of the improvements to existing Microsoft developer products are aimed directly at simplifying the creation or use of ActiveX components. A full complement of tools is provided to create HTML-based presentation layers in addition to the more traditional Windows®-based application programming tools. A comprehensive set of data management tools helps with the routine creation and maintenance of the underlying databases.
A second target of Visual Studio is the corporate client-server application. The same basic architecture applies to both types of applications. Corporate applications tend to focus a little more on the database side of things, though, and the Visual Studio Enterprise Edition contains even more tools for creating large-scale database and transaction-processing applications.

What's in the Box?

Visual Studio 97 comes in two editions, Professional Edition and Enterprise Edition. Figure 1 lists the contents of each edition. As you can see, the Enterprise Edition focuses more on database development than the Professional Edition. The first thing you'll notice is that Visual Studio is big, very big. The beta-2 Enterprise Edition I worked with came on five jam-packed CDs.
The best decision anyone made for Visual Studio was to put all the documentation on a single CD. The Microsoft Developer Network (MSDN) Library CD provides one-stop shopping for technical information about the Visual Studio tools. In addition to the product documentation, the CD contains a snapshot of the Microsoft KnowledgeBase, a collection of thousands of articles created by Microsoft technical support specialists.
Augmenting the MSDN Library CD will be Visual Studio Online, a Web site devoted to the Visual Studio toolset. Product and documentation updates, new samples, and helpful technical articles will appear here first. Visual Studio tools even have Help menu items that take you directly to their respective home pages.

Installation

Be prepared to set aside a significant amount of time—and disk space—to install Visual Studio. Figure 1 shows you the minimum and maximum hard disk space requirements for each component of Visual Studio. You don't have to install all the components on the same drive, but most apps will need to install files into the Windows system directory. You can reduce the amount of disk space needed by accessing the documentation and sample code from the CD.
The beta-2 version I worked with took a long time to install because the main Visual Studio install program simply triggers each tool's individual install program. In a couple of cases, the installation program requires a reboot to finish installing some files, which means that after you reboot, you need to start up the Visual Studio install program again and work your way through to the screen that lists the individual components you can install (see Figure 2). However, each individual installation program did what it was supposed to.
Figure 2: Visual Studio 97 Master Setup
Figure 2: Visual Studio 97 Master Setup

Once everything is installed, you'll see that your Start menu has a lot of new items. Each individual application makes its own start menu entry, and some common tools appear on multiple menus. (Unfortunately, these tools are also installed in multiple places on your hard drive.) Some applications create their Start menu entries in the user-specific menu and others create their entries in the menu common to all users. I would like to see better coordination between the different application setup programs when creating Start menu entries and installing common tools. I expect this to be much improved in the retail release.
I must admit that after installing the Visual Studio beta 2, I was feeling a little negative toward the product. Installing it took too long and used too much hard drive space. But once I actually starting working with the tools, my whole attitude changed. Believe me, the tools are worth the wait.
Let's take a look at each of the tools that comes with Visual Studio. First, I'll look at the language tools. They primarily provide a development environment for a programming language—Visual Basic, Visual FoxPro™, Visual C++®, and Visual J++™. After I look at the languages, I'll go over the Web content authoring tools that make up Visual InterDev™. Finally, I'll take a brief look at the enterprise tools—Visual SourceSafe™, Microsoft SQL Server™, and Microsoft Transaction Server.

Visual Basic 5.0

Visual Basic is Microsoft's RAD tool for Windows programmers. Visual Basic uses a graphical, forms-based approach to application development. The typical way to write a program in Visual Basic is to create a form, drag and drop components onto the form, set properties for the form and its components, and add application-specific code to handle events. It sounds simple, but you can write some very powerful applications this way.
The great thing about Visual Basic is that it hides most of the gory details of Windows-based programming and lets you focus on your application-specific functionality. Pretty much every service you use in a Visual Basic program is provided by an ActiveX component. Once you've learned how to use one component in Visual Basic, using any other component is simply a matter of learning how its object model—its properties, methods, and events—works.
If you've used Visual Basic before, one of the first things you'll notice is that Visual Basic 5.0 has a new integrated development environment (IDE). Figure 3 shows the IDE just after a new control project has been created. Unfortunately, this IDE is not the same one that other tools in Visual Studio use. The IDEs are becoming more similar, but there are still differences in their capabilities that may catch you by surprise if you move back and forth between them.
Figure 3: Visual Basic 5.0 IDE
Figure 3: Visual Basic 5.0 IDE

The Visual Basic 5.0 IDE now has a traditional Windows MDI look. If you don't like this, you can switch back to SDI mode from the Tools|Options command. Windows and toolbars can float or be docked to each other or to the edge of the screen. The IDE is very flexible so that you can organize things for maximum productivity. The IDE even lets you open multiple projects simultaneously—critical for debugging projects with user-created controls. If the features provided by the IDE aren't sufficient, you can create add-ins to extend it.
The IDE code editor has some new features that you'll soon wish were in every product you use, including List Properties/Methods, which presents a dropdown list of properties available for that control, and Auto Quick Info, which displays the syntax for statements and functions. Complete Word fills in the rest of the word you are typing once you have entered enough characters for Visual Basic to identify the word you want. Parameter Info (see Figure 4) shows a popup in the Code window that contains information about the parameters of the initial function or statement. Quick Info provides the syntax for a variable, function, statement, method, or procedure selected in the Code window.
Figure 4: Parameter Info Popup
Figure 4: Parameter Info Popup

In addition to the IDE changes, Visual Basic now provides a native code compiler. Earlier versions of Visual Basic compiled applications into p-code, which required a runtime interpreter that reduced application performance. The native code compiler lets you compile your apps down to Intel-native instructions. You can even optimize for specific processors, including the Pentium and Pentium Pro. Whether you compile your app to native code or p-code, you still need to ship the Visual Basic runtime files, but native code applications will run much faster. (Even though compiling to native code generates machine code, the machine code still needs to make some calls to helper routines that live within the Visual Basic runtime.)
Visual Basic 5.0 Enterprise Edition provides enhanced client/server database development features. Remote Data Objects (RDO) has been improved to include local cursor support, optimized batch updates, and direct access to ODBC data sources without going through the Jet engine. You can now create standalone connection and query objects. A Connection Designer is provided to help create these objects at design time and a Data Form Wizard automatically generates forms used to manage database information. Integrated T-SQL debugging lets you verify stored procedures executing on a Microsoft SQL Server database.
With version 5.0, Visual Basic also expands its capabilities to encompass ActiveX component creation. Visual Basic 4.0 was able to create Automation servers, which are a type of component, but did not support more powerful component features. Visual Basic 5.0 lets you create components that raise events, support data binding, support licensing, have property pages, and are Internet-aware. Visual Basic can create several types of components, including Automation components (that Visual Basic calls ActiveX Code components), ActiveX controls, and ActiveX Documents.
All ActiveX components in Visual Basic are defined by creating class modules. Creating an Automation component isn't much more complicated than defining your object's data and implementing a few procedures. Visual Basic takes care of all the goo to turn a class module into an Automation dual interface. Using the new Implements feature, classes can even support any Automation-compliant interface already defined in a type library. You define events in your class module using the Event keyword, and raise events using the RaiseEvent keyword. Clients use the new WithEvents keyword to indicate that they want to handle events from a particular object, then implement event handlers just as they would for any other event.
Using the Enterprise Edition, you can mark your components for unattended execution, which means they have no user interface. When you do this, the components can be used in multithreaded environments. In-process components (DLLs) marked for unattended execution support the COM apartment threading model. Out-of-process components (EXEs) marked for unattended execution will allocate object instances across multiple threads for better scalability as instances are created.
The Enterprise Edition also provides full support for deploying components remotely. Remote Automation (RA) was originally developed for Visual Basic 4.0 Enterprise Edition and extends OLE Automation so that it works across machine boundaries. It is compatible with and can be replaced by Distributed COM (DCOM). However, there are some situations when RA is more appropriate than DCOM. In particular, you need to use RA if you want to support 16-bit clients, since there is no DCOM support for 16-bit Windows. Fortunately, you don't need to write your applications any differently to use RA or DCOM. In fact, Microsoft supplies configuration utilities that you can use to switch between RA and DCOM: the Remote Automation Manager (AUTMGR32), and the Remote Automation Connection Manager (RACMGR32).
Visual Basic 5.0 makes ActiveX control creation incredibly easy. You can either combine existing controls into a new component or create a component from scratch. Either way, you use a special kind of object, called a UserControl, as the basis for your ActiveX control. Once you've added any constituent controls to the UserControl, you use the ActiveX Control Interface Wizard to specify which properties, methods, and events your composite control will expose to clients. You can create property pages for your control using the PropertyPage Wizard.
The major limitation to the Visual Basic 5.0 control creation features is that the controls you create are single-threaded. In addition, I didn't see any support for windowless controls. But if you can live with these restrictions, Visual Basic now provides a great way to create powerful, lightweight controls. If you'd like to know more, take a look at Guy and Henry Eddon's articles in the February and March 1997 issues of MSJ.
Using another special object called a UserDocument, you can create ActiveX Documents as easily as you design a form. When you create an ActiveX Document in Visual Basic, you add controls to a UserDocument instead of adding them to a Form. In fact, Visual Basic provides a wizard for converting ordinary apps into ActiveX Documents: the ActiveX Document Migration Wizard. This wizard converts the project type to ActiveX Document DLL or EXE and adds a UserDocument to the project. It then copies a form's properties, controls, and the code behind the controls to the UserDocument object, and migrates form event handlers to the UserDocument equivalents.
ActiveX Documents created with Visual Basic are a little different than other ActiveX Documents you may have encountered. Visual Basic ActiveX Documents are roughly equivalent to Visual Basic forms that can only be hosted in ActiveX Document containers—you can't run them as standalone applications. ActiveX Documents are typically activated by accessing a file. When you create an ActiveX Document project in Visual Basic, it generates a file with a .VDP extension. This is a structured storage file containing the CLSID of the ActiveX Document that should be launched, and any persistent properties exposed by the document. However, the emphasis in Visual Basic seems to be related more to making a Visual Basic application run within a document container such as Internet Explorer than on the "persisted" data (contrast this with Word, where the emphasis is clearly on the persistent document).
Once you've created a component, you'll need to distribute it to your clients. Visual Basic provides a Setup Wizard to help you with all the packaging issues associated with distributing applications and components. The wizard has been enhanced in version 5.0 to support distribution via the Internet. It also supports installation of remote server components using either DCOM or RA.

Visual FoxPro 5.0

Visual FoxPro is a relational database system that provides powerful query and reporting capabilities as well as visual design tools for generating forms, queries, and reports (see Figure 5). Originally based on the dBase language, Visual FoxPro has evolved to include a complete object-oriented programming environment. The IDE offers multiuser project and database management support, including visual tools for designing tables, queries, and views. Visual FoxPro is fully integrated with source code control products such as Visual SourceSafe.
Figure 5: Visual FoxPro 5.0
Figure 5: Visual FoxPro 5.0

Like Visual Basic, Visual FoxPro provides a graphical forms designer. Your forms can contain built-in FoxPro controls or ActiveX controls. Builders and designers help you configure control properties. Using Visual FoxPro class libraries, you can even create new controls, either from scratch or by customizing existing Visual FoxPro classes. Numerous wizards are provided to help you create applications quickly. An Application Wizard generates a skeleton app for you. The Report Wizard generates professional-looking reports. There's even a Web Wizard to generate Web pages to query and display database records.
In addition to accessing data via the Visual FoxPro database engine, you can access any ODBC data source from a Visual FoxPro-based application. This makes Visual FoxPro a useful tool for creating front-ends for distributed applications. You can even develop your app against a Visual FoxPro database, then upsize the database to run on SQL Server or Oracle databases.
Visual FoxPro also provides limited support for creating Automation servers, which can be deployed locally or remotely using RA. (Visual FoxPro provides the same RA management tools as the Enterprise Editions of Visual Basic and Visual C++.) These servers are single-threaded and cannot fire events. However, even with these limitations, you may find Visual FoxPro to be a useful tool for creating middle-tier business objects—particularly those that interact with data management services.

Developer Studio

Developer Studio is the IDE used by the rest of the tools included with Visual Studio—Visual C++, Visual J++, and Visual InterDev—as well as the MSDN Library. Developer Studio consists of a shell that various packages can be plugged into. A package typically corresponds to a language such as Visual C++, or a tool such as Visual InterDev or NuMega's BoundsChecker. The shell provides standard functionality that all packages can use. With this plug-in approach, new packages are automatically integrated into Developer Studio as soon as they are installed on your system.
If you've used Developer Studio in the past, Developer Studio 97 will look familiar. Appearances can be deceiving, though. Developer Studio has some interesting new features.
Developer Studio uses project workspaces to help you organize your work. Workspaces include projects and your preferences for how project information appears on the screen. Projects organize the files required to create specific targets. One workspace can contain multiple projects (in-dependent or interdependent) and projects can be nested. You can also create projects using different Developer Studio packages. For example, a single workspace might contain pages for a Web site created using Visual InterDev, a Visual C++ project to create a custom server-side object, and a Visual J++ project to create a client-side applet (see Figure 6).

Figure 6 Developer Studio 97
Figure 6 Developer Studio 97

Although the project management user interface looks similar to previous versions, there have been several improvements. A single dialog is used to create new workspaces, projects, and files, instead of the separate project and file dialogs used in earlier versions of Developer Studio. When you create a new file, you can select the project or workspace you want to add it to. Developer Studio is now an ActiveX Document host, which means you can view any ActiveX Document, such as a Word document or Microsoft Excel worksheet, within the IDE. You can also add ActiveX Documents to your projects. This is handy for keeping track of specifications, project plans, and so on. All this additional flexibility requires new project and workspace file formats—project files now have the extension DSP rather than MAK or BLD, and project workspace files now have the extension DSW rather than MDP.
Sharing project workspace files is a problem that has plagued development teams using Developer Studio since its inception. Microsoft has finally managed to eliminate all machine-specific information from the workspace files so that everyone on your team can use the same workspace without needing exactly the same directory configuration. Machine-specific information is now stored in a workspace options file (OPT). You share the workspace and project files among team members, but each team member has his or her own options files.
Developer Studio is also Internet-aware. You can use a new InfoViewer (based on the Internet Explorer Web-Browser control) or your own Web browser to view Web pages within the IDE. When a URL appears in a window, clicking on the URL takes you right to the Web page. The Help menu includes a new item, Microsoft on the Web, that connects you to important developer sites on http://www.microsoft.com, including Visual Studio Online.
Perhaps the most interesting new feature of the Developer Studio IDE is that it exposes a rich Automation object model that can be manipulated from within Developer Studio by using VBScript macros or DLLs called add-ins. Of course, Automation can also be used to control Developer Studio from other applications too.
VBScript macros are procedures containing VBScript commands. You cannot pass any parameters to VBScript macros. Macros can be created by recording keystrokes which are automatically converted to VBScript, or by writing the VBScript code yourself.
One of the things I like to put in every source file I create is a comment block with Visual SourceSafe keywords. Visual SourceSafe takes care of updating the file name, last revision date, and so on. Manually adding this block in every file is a pain though, so I wrote a VBScript macro to handle this task. It figures out what type of file is active and inserts a standard comment block above the current selection. The macro, InsertVSSHeader, is shown in Figure 7, MYMACROS.DSM. After assigning the macro to an available keystroke, adding a header is a piece of cake.
Developer Studio add-ins can be written in Visual C++, Visual Basic, or other languages that can create in-process Automation servers. Add-ins can contain multiple commands to be added to Developer Studio, as well as the code to connect these commands to toolbar buttons and key sequences. A wizard is provided to help you start writing an add-in using Visual C++. Sample add-ins provide standard code you can cut and paste into your own add-ins.
VBScript macros are easier to create than add-ins, but they're not as versatile. Macros can only access the Developer Studio object model. Add-ins, on the other hand, can access all the resources of your system—including other object models. This is a significant difference. For example, if you want to read information from a text file during your processing, you would need to go through major contortions in VBScript, which has no file system commands of its own.
The Developer Studio editors haven't been ignored. Many user-interface improvements make locating and maintaining your resources and source code easier. In particular, syntax coloring is now available for many languages—C++, Java
, VBScript, IDL/ODL, SQL, and several variants of HTML. Take a look at the "What's New in Visual Studio" topic in the online help for the highlights.
You'll also see a more functional WizardBar and Class View. Early versions of these tools were tied to Visual C++. Now any language package can use them (Visual C++ and Visual J++ do). Class View and WizardBar complement each other: Class View lets you see all the classes in all the projects in the current workspace, while WizardBar shows you a single class within the active project. Unlike Class View, WizardBar tracks where you are in the source editor to display context-sensitive class information. For Visual C++, WizardBar extends the functionality of the dialog editor, making it easy to add event handling code for your dialogs. Class View and WizardBar both have a convenient way to add properties and methods to your classes; this has been extended to support editing COM interfaces or dispinterfaces defined in IDL or ODL files. If you're using the ActiveX Template Library (ATL) or MFC, this even creates a stub function in the appropriate H and CPP files.
Developer Studio, like MSDN, uses an online documentation system called InfoViewer, now based on Microsoft Internet Explorer. Documentation is stored in InfoViewer title files, which have the extension .IVT, and are compressed HTML files. Although the implementation of InfoViewer has changed, I did not see any major change in functionality—you can still do full-text searches across titles, define information subsets, create bookmarks, print complete books, access sample code, and so on.
The new InfoViewer is Internet-aware, and topics may contain links to Internet Web sites. The docs can even be incrementally updated over the Internet. If you click on a link to a Web site, an Internet connection will be established. You can also enter a URL into the listbox on the InfoViewer toolbar. InfoViewer Internet navigation uses the Internet Explorer options, and they must be set before an Internet connection can be completed.

Visual C++ 5.0

You'll have to dig to find most of the updates from previous versions of Visual C++. Not that the changes are insubstantial, they're just not as visible as a new IDE.
On the compiler front, there have been updates to better conform with the C++ standard. Visual C++ 5.0 now supports the keywords bool, explicit, false, mutable, true, and typename. This will undoubtedly thrill the C++ gurus, but may cause you C++ programmers grief if you've used these words for your own purposes. Visual C++ 5.0 also ships with an ANSI Standard C++ library that conforms to the working paper produced by the Stockholm meeting of July 1996. There have been some changes to the compiler options you can use as well. If you're upgrading from a previous version of Visual C++, I'd suggest looking at the "What's New" section of the documentation to see if any of these changes will affect your app.
In an intriguing move, Microsoft has added special support for COM to the Visual C++ compiler itself. This support simplifies creating COM clients—for instance, applications or other components that use ActiveX components. Microsoft has added a new preprocessor keyword, #import, which is essentially #include for type libraries. When you import a type library into your C++ code, the preprocessor reads the type library, creates a C++ header file describing the included COM interfaces as C++ classes, and creates a second header file containing the implementation of these classes. You can read more about the compiler support for COM in George Shepherd's article in this issue of MSJ.
If you prefer to work at a slightly higher level of abstraction, Visual C++ includes two class libraries. MFC is an established framework for Windows-based application development and ActiveX control creation. The ActiveX Template Library (ATL) is a relatively new library designed specifically for creating small, fast ActiveX components.
There have been a few updates to MFC since version 4.2b, primarily for Internet and database support. ActiveX Documents written in MFC now support all the features required for hosting in both Internet Explorer and Office Binder. MFC also supports asynchronous URL monikers. On the database front, MFC supports DAO 3.5 and ODBC 3.0. It supports binding simple and complex data controls to any ActiveX data control, including the Remote Data Control shipped with Visual C++ Enterprise Edition.
Previous versions of MFC were able to create Automation components, ActiveX controls, and ActiveX Documents. You won't see any major changes here. Components can support apartment model threading, but cannot be free-threaded. Unlike Visual Basic, MFC does provide support for windowless controls. However, MFC doesn't support dual interfaces directly.
ATL takes a radically different approach from MFC. It focuses on one thing—creating small, fast ActiveX components. (For more information see "Developing and Deploying ActiveX Web Components: A Tools Overview" by Michael T. McKeown and Mary Kirtland, MIND, April 1997.) Early versions of ATL only had built-in support for only the most basic COM functionality. With ATL 2.0, the ability to create ActiveX controls was added. Visual C++ 5.0 ships with ATL 2.1, which offers better integration with the Developer Studio IDE and wizards to create more kinds of objects. (You'll also see significantly smaller components when you compile with Visual C++ 5.0, due to better code-generation optimizations.)
Of all the tools included with Visual Studio, ATL offers the most flexibility in creating components. It supports all COM threading models and lets you build components as DLLs, EXEs, or services. Unlike MFC, ATL supports dual interfaces. And since ATL is a C++ template library, all code gets included in your component—no runtime DLL is required. ATL uses templates and multiple inheritance to implement objects. If you're not comfortable with these C++ features, you may find using ATL rough going. However, the wizards provided are a great help in creating the basic framework for your component and adding object classes to it. Figure 8 shows the ATL Object Wizard.

Figure 8 ATL Object Wizard
Figure 8 ATL Object Wizard

Visual C++ 5.0 Enterprise Edition provides better SQL support than earlier Visual C++ versions. A Data View pane in the project workspace window simplifies working with ODBC data sources. The text editor color-codes SQL statements to help reduce syntax and spelling errors. Combined with the Data View's ability to generate skeletal triggers and stored procedures, this helps you create SQL scripts and procedures. The integrated SQL debugger helps track down errors in your stored procedures.
In addition to working directly with SQL or using MFC to work with DAO or ODBC, you can use data controls that ship with Visual C++ 5.0 to connect to local or remote databases. These controls also ship with Visual Basic 5.0. (See Figure 9 for a list of the controls that are available.) You can bind the MSDataList, MSDataCombo, Data Bound Grid, Masked Edit, and Calendar controls to the Remote Data control. When you do this, data accessed by the Remote Data Control is displayed in the data-bound control. This helps you write Visual C++-based apps that can view and maintain database records. Remote Data Objects is used to manipulate the data control. When you insert the control into your project, Visual C++ automatically creates the C++ class framework for manipulating the control.

Visual J++ 1.1

Visual J++ is Microsoft's Java development tool. Like Visual C++, Visual J++ uses Developer Studio as its IDE. Figure 10 shows a debugging session in progress. Note that the debugger disassembly window shows the bytecodes being executed.

Figure 10 Visual J++ debugging session
Figure 10 Visual J++ debugging session

Visual J++ has wizards to help you generate the generic parts of your Java applets and applications. The Applet Wizard generates a starting framework that will run as both an applet and an application. You can elect to have the wizard provide multithreading support, animations, mouse event handlers, and more—it will even generate a sample HTML page for testing the operation as an applet.
Java applets use Abstract Windowing Toolkit (AWT) code to specify UI elements such as menus and dialogs. Instead of writing this code by hand, you can use graphical resource editors in the IDE to create your UI elements and store them in a resource template file. You then use the Java Resource Wizard to convert that file into the appropriate Java code.
Microsoft's reference implementation of the Java Virtual Machine (VM) integrates Java and ActiveX. Using Visual J++, you can build components with Java and expose their functionality as COM interfaces. You can also write client applications and higher-level components in Java that glue together existing ActiveX components. The Java Type Library Wizard is used to create Java classes that interface with the ActiveX components described by a type library. (Sounds a lot like Visual C++ #import, doesn't it?) Take a look at the April 1997 Visual Programmer column in MSJ and "Understanding the Java/COM Integration Model," by Guy and Henry Eddon, MIND, April 1997 to learn more about Java/COM integration.

The Web Content Tools—Visual InterDev 1.0

Visual InterDev (formerly Internet Studio) is a complete set of tools for creating dynamic, data-driven, Web applications for the Internet and intranet. With Visual InterDev, you can edit static content files, create, manage, and work with ODBC databases and connect them to your Web application, add client and server-side scripting to HTML pages using VBScript or JScript, and manage multi-user Web projects.
When you create your Web application with Visual InterDev, you work with a Web, which is the actual set of files out on the Web server, and a project, which is the working directory and files located on your development machine. Visual InterDev includes Web project wizards that create the working directory on the development machine, create project and workspace files, create (if necessary) and configure the Web on a Web server, and create a set of starter files for the Web. Multiple developers can work on the same site and multiple projects can point at the same Web. Visual InterDev lets you decide whether multiuser projects should permit free-for-all changes or should use source control. When source control is enabled, file locking on the Web server is used to prevent multiple users from changing files.
To create HTML, you can use the Developer Studio text editor, the FrontPage WYSIWYG HTML editor, or any other editor you might prefer. To activate your Web page, you add controls and scripting. The editors make it extremely easy to add controls to your pages. If you're not a VBScript or JScript
guru, Visual InterDev supplies a Script Wizard that provides limited point and click client-side scripting support. Visual InterDev keeps track of the relationships between Web files and can update links when you move a file. A Link View tool lets you see the connections between your Web pages graphically. Figure 11 shows the link view and FrontPage editor in action.

Figure 11 Frontpage and LinkView in action
Figure 11 Frontpage and LinkView in action

Visual InterDev's strength is its support for creating data-driven applications using Microsoft Active Server Pages. (For more information about Active Server Pages, take a look at my article, "Writing a Smart Server Application with Denali," MIND, December 1996.) Data-driven Active Server Pages tend to have a lot of code, much of which is the same no matter what database is accessed or how the data is displayed—the ideal scenario for a wizard. That's exactly what Visual InterDev provides: wizards to generate common code for Active Server Pages. Visual InterDev also provides something called Web Designers that help you create and initialize instances of server-side controls in your Active Server Pages. Using these designers is a little disconcerting if you are editing your pages in text mode because a visual editor is displayed. The Visual InterDev designers don't really make a compelling case for using them—it's faster to type in the little bit of code they generate than it is to use the designer, and the handwritten code is easier to read. For complex server-side objects such as the data command control, a design-time interface would be extremely handy.
Once you've got some content, Visual InterDev lets you test it out in your browser (Internet Explorer by default) from within the IDE using the Preview command. This is important for Active Server Pages, which must be run from the Web server to generate the client-side content; you can't just open up the file and expect to see what Web clients will see. You can also test alternate browsers using the Browse With command—very handy. The text editor's syntax coloring is a helpful addition to actual testing in multiple browsers. You can select different versions of HTML to control syntax coloring, and unrecognized tags show up in a different color.
Visual InterDev includes Visual Data Tools to help manage your application databases. The tools include a graphical Query Designer and Database Designer. If you've used Microsoft Access and Query, these tools will look familiar. Database Designer helps you create, edit, and delete Microsoft SQL Server 6.5 database objects. Query Designer helps you construct SQL statements to query or update databases.
Visual InterDev also includes several tools for creating and managing multimedia content. Image Composer is a sprite-based image editor. To create images in Image Composer, you take existing images (sprites), apply various imaging effects, and put the images together to form a composition. These images can then be saved in standard image formats that Web browsers understand. Music Producer is a program you can use to create music. You specify information such as tempo, key, style, mood, and instruments, and Music Producer generates an original composition for you. This works better for some types of music than others: the compositions Music Producer generated for me tended to be heavy on the rhythm section and light on the melody (think about the electronic organ demonstrations at your local mall and you'll get the idea). But if you need background sounds for your Web site and can't compose your own, Music Producer is the answer.
Finally, Visual InterDev includes a tool for keeping track of media. If you've ever wasted half an hour trying to locate that way-cool bullet that would be absolutely perfect for your new Web page, or ended up with half a dozen applets cluttering the screen while picking out background images and sounds, you'll appreciate Media Manager. Media Manager is so seamlessly integrated into the Windows shell that, if it weren't for the startup screen that automatically loads with Windows, you might never realize it's there. Although you might think Media Manager is just for graphics, audio, and video files, you can actually keep track of many kinds of files with it. All you need to do is create a Media Manager directory (by right-clicking on a directory and selecting "Convert to a Media Manager folder," or by selecting New|Media Manager folder) and start adding files to it. Figure 12 shows a Media Manager view of some audio files. Media Manager also keeps track of file properties—both those it understands automatically in supported file types and any annotations you add yourself—so that it can provide enhanced file find capabilities.
Figure 12 Media Manager
Figure 12 Media Manager

Visual InterDev is a powerful, full-featured tool for creating and managing Web content, and I've obviously just hit the highlights here. For more details, take a look at the March 1997 MIND.

The Enterprise Tools

Visual Studio 97 Enterprise Edition includes Developer Editions of Microsoft SQL Server 6.5 and Microsoft Transaction Server 1.0. Developer editions are full-fledged copies of the respective products with restricted licenses that prohibit deployment of your applications. This lets you develop and test your applications within your development team, for example, before handing the app over to your IS manager for company-wide deployment. Your team can work on its own private database server, without affecting production applications—and without purchasing a production copy of SQL Server or Transaction Server.
If you're not familiar with Microsoft Transaction Server (formerly codenamed Viper), it provides development tools and runtime services for building high-performance, scalable applications with transactioning.

Figure 13 Visual SourceSafe
Figure 13 Visual SourceSafe

The Visual Studio Enterprise Edition also includes the latest version of Visual SourceSafe, Microsoft's source code management tool. It is fully integrated with the Visual Studio tools, and with Microsoft Access and Microsoft FrontPage. Visual SourceSafe is a project-oriented version control system for tracking changes to any type of file. As you can see in Figure 13, Visual SourceSafe provides a hierarchical view of your project files. Development team members can share files, modify them independently, and merge changes or revert to earlier versions if necessary. Like most version control systems, you can add comments about the file you are checking in or out, then later review the file's history. A separate administration program lets you control who has access to which files.
Perhaps the most interesting new feature of Visual SourceSafe version 5.0 for Visual Studio users is its Web site management feature. To create a Web site, you collect a set of files and check them into a Visual SourceSafe project. Designating the project as a Web site project using the Administrator program enables several useful features: Check Hyperlinks, which looks for invalid links on your site, Create Site Map, which creates a map of all the Web pages on your site, and Deploy, which moves an entire project onto a designated Web server.

Summing Up

Microsoft's aim in creating Visual Studio 97 is to provide you the tools you need to develop applications that integrate the best of the Internet and the best of client/server computing—applications that can be built once and deployed everywhere.
ActiveX components are central to Microsoft's distributed applications architecture. While there are thousands of ready-to-use components you can purchase, at some point you'll probably want to write your own. Visual Studio 97 provides a multitude of options for creating components. Each tool optimizes for different scenarios and has different constraints (see Figure 14). Instead of forcing you to use a one-size-fits-all tool to create your components, Visual Studio 97 gives you the flexibility to use the tool that best meets the needs of your development project. And since ActiveX is language-neutral, the components will work together regardless of how they were developed.

From the May 1997 issue of Microsoft Systems Journal. Get it at your local newsstand, or better yet, subscribe.

© 1997 Microsoft Corporation. All rights reserved. Legal Notices.

© 2015 Microsoft Corporation. All rights reserved. Contact Us |Terms of Use |Trademarks |Privacy & Cookies
Microsoft