New Wizards

One of Visual Basic's strong points is its collection of wizards, which serve to automate complicated or mundane development tasks. For example, the Setup Wizard (renamed in VB6 to the Package and Deployment Wizard) enables you to quickly and easily create setup programs and archives for the distribution of applications and components. How time-consuming and dull this chore would be without the wizard - thank you, VB!

Other versions of Visual Basic have seen new wizards being added and others enhanced, and VB6 is no exception. Several changes and additions have been made to VB's stock of helpful wizards. Although we will only cover a few of them in detail in this book, that should be of no consequence. Wizards are, for the most part, embarrassingly easy to use. Experienced programmers should have no trouble at all in figuring them out.

Though simple to use, some wizards do deserve a closer look. The Class Builder Utility, which has been enhanced in VB6, is covered in Chapter 11, "Creating and Using Class Modules."

In the area of database access, one wizard has been added and another has been enhanced. The new Data Object Generator Wizard enables you to easily create middle-tier objects that are bound to UserControls and the Data Environment. The Data Form Wizard has been updated so you can now build code-only forms with no bound controls, and it also has the ability of producing DAO or RDO code.

Two more utilities have also been added to VB6: the Add-In Designer and the Toolbar Wizard. They are discussed briefly in the following sections. Changes to the Package and Deployment Wizard (formerly the Setup Wizard) and the Application Wizard are also discussed in the following sections.

The Add-In Designer

The Add-In Designer can't technically be considered a wizard, but it's close. Actually, it's a class that can be added to a project to facilitate the development process for an Add-In. It enables you to set properties that determine the Add-In's name, description, target application and version, initial load behavior, and other pertinent pieces of information. The Add-In Designer then provides code for the Add-In's DLL or EXE file to ensure that the Add-In registers correctly with its target application.

The Application Wizard

The Application Wizard hasn't changed too drastically from the version that shipped with VB5. However, some new options have been added that make this already powerful wizard even more flexible.

To begin with, you are given much greater control over the creation of menus and submenus (see Figure 1.1). You can also launch the Data Form and Toolbar Wizards from within the Application Wizard if they are pertinent to the application you are creating.

Figure 1.1

The Application Wizard gives you greater control over the creation of menus and submenus.

If you find yourself creating the same type of applications over and over again with the wizard, you can save your choices as a profile. When invoked, the first thing the wizard will prompt you for is the name of an existing profile. If you have one you want to use, all of the options you chose for that profile will be loaded in and you can step through the wizard and make any necessary changes.

The Package and Deployment Wizard

Formerly called the Setup Wizard, the Package and Deployment Wizard (see Figure 1.2) has gotten more than just a name change and a facelift. For starters, it now supports a wider range of data access formats, including ADO, DAO, ODBC, OLE DB, and RDO. What's more, the wizard can be run as an Add-In from within Visual Basic or as a stand-alone utility.

Figure 1.2

The Package and Deployment Wizard, formerly called the Setup Wizard.

The "package" part of the wizard refers to the bundling of a Visual Basic project into a distributable package, either a compressed CAB file or an executable Setup program. Of course, you can still optionally create multiple CAB files, broken down into one of five selectable sizes; small enough to fit on a standard 1.44MB diskette, for example.

The new wizard gives you control over the Start menu groups and items that are created by a Setup program. You can also specify that one or more distribution files be installed as shared files.

Once a package has been created, it can then be "deployed" to a distribution site, such as an Internet server. Various deployment options are available, including FTP and HTTP. When the wizard is complete, it will attempt to send the package to the server that was specified. If you don't want to deploy the package to a server, you can choose to move the package to a local or network folder instead.

After going through the necessary steps for packaging and deployment, the wizard enables you to save your options as a script. That way, if you ever need to repeat the process, you can use the script instead of having to go through all of the motions again. Don't worry if you start growing a large collection of scripts; the wizard includes options for handling (renaming, duplicating, and deleting) any scripts you might have created.

The Toolbar Wizard

The new Toolbar Wizard (see Figure 1.3) makes it easy to add toolbars to a Form, UserDocument, UserControl, or Property Page. Although the wizard provides dozens of pre-existing icons, you can also use any other icons you may have available as long as they're stored as .BMP or .ICO files.

Figure 1.3

The Toolbar Wizard makes the creation of toolbars a snap.

Although this wizard can be used separately, it can also be launched from within the newly-enhanced Application Wizard.

Top Home