Client/Server Meets ActiveX in the Latest Version of Microsoft's Trusted Application Development Tool.
Question: What does Visual Basic have that most other tools don't? The answer: three million developers. Visual Basic is always in the top three client/server development environments that I encounter, and as the others seem to stumble, Visual Basic, with the massive resources of Microsoft Corp., could be poised to take over.
Visual Basic Version 5 (VB 5.0) is the next Visual Basic evolution. Wrapped around Microsoft's Active Platform, VB 5.0 will be the mechanism not only for creating ActiveX components for clients but also for Web browsers, Web servers, and even Microsoft's new Transaction Server (formerly Viper). VB 5.0 is ready for client/server as well, with a new native compiler and speedy database link. Although other tools are also able to create components, VB will be the path of least resistance for some time. This review is based on the beta of Visual Basic 5.0 that was available at press time.
The best feature, which I'm concentrating on here, is the component creation capabilities of the ActiveX technologies in VB 5.0. At last, developers have an ActiveX development environment that does not require deep skills in C++. Using VB 5.0, developers can create component-based applications targeting the Internet, Intranet, and traditional client/server environments.
In addition to the new ActiveX development focus, there is a new version of VBA (Visual Basic for Applications, which Tom Spitzer discusses this month in his column on page 75), a new incarnation of the IDE (integrated development environment), and the inclusion of IntelliSense technology (explained later). There is also now a true repository (Microsoft Repository 1.0) for those of us who want to build up from the database. Microsoft Transaction Server Developer Edition finally enables VB to scale to hundreds of users. The T-SQL Debugger enables developers to debug stored procedures interactively, at the same time, and on the same IDE client. Last but not least, an Application Performance Explorer (APE) lets you simulate and analyze distributed application scenarios before committing to a specific architecture. This process lets you optimize an application and an architecture for performance.
VB 5.0 provides the same development paradigm as Visual Basic 4.0. Developers build interfaces by assembling prebuilt component parts. VB 5.0 applies the same paradigm to the construction of ActiveX controls, sharing the same development features for traditional Visual Basic applications. Developers can build controls from scratch, from subclass controls, or by combining any number of more than 1,000 commercially available ActiveX controls. Once created, these ActiveX controls can be included in other development environments that are ActiveX-friendly. They can also be downloaded and run in ActiveX-aware Web browsers such as Microsoft's Internet Explorer and even used to program Internet Information Server (IIS) and Microsoft's new Transaction Server. In other words, they create the bricks with which you can build all sorts of houses.
VB 5.0 comes in three flavors: the Learning edition for those who just want to play, the Professional edition for those who want to create basic client/server and Internet/Intranet applications (included in the Professional edition are the ActiveX Control-creation features, the repository, and the native compiler), and finally the Enterprise edition for those who need to automate an entire corporation. The Enterprise edition includes SQL Server, Visual SourceSafe, Remote Data Objects (RDO), Transaction Server Developer Edition, and Microsoft Database Tools.
The change in the IDE is more of an evolution than a revolution. I found that it's a better programming environment. Existing VB 4.0 developers won't have a problem finding their way through the new interface and features. Those new to VB won't have much of a problem, either. VB 5.0 maintains the Visual Basic reputation of providing an easy-to-use RAD environment. Developers assemble the interface using prebuilt GUI controls, and then they provide the application with behavior by placing code behind the control or by changing properties of a control. Remember, this is the same paradigm exploited by competing tools such as Borland International Inc.'s Delphi and Oracle Corp.'s PowerObjects.
What you'll find new with the VB 5.0 IDE is the new IntelliSense features, multiproject support, an enhanced editor, project and properties windows, and new debugging tools. There is also a new layout window.
The IntelliSense feature is really just a syntax-reference object model that protects developers from their worst enemy: themselves. I found it handy because it's been some time since I played with VBA. Advanced developers will find IntelliSense useful as well. IntelliSense features that are available from the code window include Complete Word, Quick Info, List Properties/Methods, List Constraints, Data Tips, and Margin Indicators.
With version 5.0, you can now load several projects at the same time. This capability is most helpful for creating controls because developers can load both the control project and the host project at the same time. The host project will create an .exe that's able to host the control for testing. From the project window you can now see all project components from all projects loaded. This includes all ActiveX Controls, forms, classes, modules, and resource files. Each project is represented by a root in the project window. Clicking on the plus sign will display what's below the root and what's included in the project.
As with the previous version of Visual Basic, the properties window displays the attributes of controls, modules, forms, and classes. With this release, you can view object properties by categories or alphabetically. There are two tabs now: Alphabetic and Categorized. As you might have guessed, the Alphabetic tab lets you view properties alphabetically, and the Categorized tab lets you view them by category.
New debugging features include the ability to add Locals windows, a Watch window, and the immediate window. The Locals window also includes a Call Stack Browser, which shows you the current variables and lets you find exactly where in the application those variables are referenced. The Local Variables window gives you information on all of the declared variables in the procedure and the values they hold. The Watch window lets you monitor the value of the particular variable or expression and permits changes to the value during execution. The Immediate window lets you examine any VBA expression of statement, and the Call Stack displays a list of all active procedure calls.
The Object Browser is new and improved as well. The browser can distinguish among built-in properties, custom properties, methods, event handlers, and user-defined procedures. The object browser is also able to display functions and return types and parameter names as well as user-defined types and constraints. A hyperlinking mechanism lets you move directly to referenced objects and enables easy navigation of the class hierarchy. You can also search for objects through all libraries at once.
Once you've created a control using VB 5.0, you can snap it into any place in which you can snap an ActiveX control, including Web pages, documents, client/server applications, and even network computing devices. Remember, ActiveX provides many of the same features as Java.
Building an ActiveX control of your very own with VB 5.0 is a relatively painless process. First you must create a test container (the application to host the control) by creating a standard .exe using VB 5.0. Next, add a blank ActiveX control project. Then draw the interface for the control. VB 5.0 uses the same visual development paradigm for building ActiveX Controls as it does for applications. It's just a matter of drawing the interface, setting the properties, and adding some event-driven VBA code. Once that's done, it's time to use and test the control. All you need to do is press F5 to run the application and watch it work. Once you're sure it works, you can give it a spin in an external application. For example, I tried my control in a few Office 97 applications and even snapped it into a Visual Basic 4.0 application.
If you don't like creating things manually, you can always use the Wizards. For instance, the ActiveX Control Interface Wizard helps you create the properties, methods, and events for user-created ActiveX controls. The Property Page Wizard automatically creates customer property pages for a user-defined control. There is even a Setup Wizard, which lets you create a .cab (cabinet) file and a working example of an HTML page.
I found that the performance was finally there. Not only did the IDE run a bit quicker -- the test applications ran at native speeds. No interpreter, no performance problems. It's simple.
The database access performance improved as well. However, I found it difficult to determine if the higher performance resulted from the addition of a new native compiler or if the database access layer was actually speedier.
It is clear that Microsoft is basing everything on ActiveX controls these days, and that's the way you're going to program most of the company's servers and clients in the future. It's also clear that Java is becoming a real threat to Microsoft. VB is bound to become the ActiveX control factory that everyone is waiting for. Until now, ActiveX Control-creation required a developer with knowledge of Visual C++ or a few other select tools.
The bottom line is that if you're an existing VB developer, VB 5.0 should be on your quick upgrade list. If you're a Web developer or even a Webmaster, VB 5.0 will help you create dynamic ActiveX content. If you plan on doing any work with ActiveX components, this is the tool to use. Microsoft is driving hard with ActiveX and the Active Platform, and it's still anyone's guess whether or not it will be a hit. The idea, however, is compelling. Application development in the near future might just be a matter of hooking components together to create both the client and the server. We might be able to purchase most of our application from component vendors rather than building it from scratch.