New Tools in Visual Basic 5.0

Chris Dias
Microsoft Corporation

New and Updated Tools

There are many new tools in Microsoft® Visual Basic® version 5.0, as well as many updated tools that were found in Visual Basic 4.0. This paper describes both the tools installed with the core product, as well as the tools found only in the \Tools directory, which are not installed by the Visual Basic Setup program

The goal here is to provide the audience with an overview of the vast array of tools available to the Visual Basic programmer and to explore some of the less obvious areas of the Visual Basic CD.

The following list highlights most of the new and/or updated Tools shipping with Visual Basic 5.0.

Application Performance Explorer TSQL Server-Side Setup
RAC Manager Help Compiler Workshop
Visual Database Tools Sample Code
API Viewer Template Manager
Setup Toolkit Dialog Objects
Service Packs Mastering Series Demo
Documentation OleView and SpyXX
Internet Tools

Enterprise Tools

Enterprise Tools are provided only in the Enterprise Edition of Visual Basic 5.0. They are specifically designed to enhance various client/server features.

Application Performance Explorer

The Application Performance Explorer (APE) is a software utility written in Microsoft Visual Basic to aid in the design, deployment planning, and performance-tuning of distributed client/server applications. It allows you to easily run automated "what-if" tests to profile the performance of a multi-tier application in different network topologies, taking into consideration such factors as network bandwidth, request frequency, data transfer requirements, server capacity, and so on.

In addition, APE is itself an example of a well-designed distributed application. Its Visual Basic source code is well commented and structured to serve as a "template" for component-based client/server applications. This source code can easily be used as the starting point for a custom multi-tier solution.

APE can be found in the \VB\CliSvr directory and is optionally installed with the other Enterprise features of Visual Basic 5.0. All of the source code for APE can be found in the \VB\Samples\Entrpris\APE directory. Finally, to assist in distributing APE, component setups can be found in the \Tools\APERedis directory. These setups were produced using the Visual Basic 5.0 Setup Wizard.

Connection Manager

The Connection Manager, also known as the Remote Automation Connection Manager (RacMan), has been updated for Visual Basic 5.0 to support Distributed COM (DCOM). RacMan is a tool for controlling the registration of ActiveX™ components. You can toggle between Local and Remote components, and specify whether to use Remote Automation or DCOM.

RacMan can be found in the \VB\CliSvr directory and is optionally installed with the other Enterprise features. It can be accessed from the Start menu under the Visual Basic program group.

T-SQL Debugger

The Transact SQL Debugger is a new feature in Visual Basic 5.0. This tool provides the means for interactively debugging Stored Procedures on Microsoft SQL Server 6.5. Debugging Stored Procedures has traditionally been a labor-intensive process, requiring the use of traditional debugging techniques due to the lack of interaction available with a Stored Procedure. With the T-SQL Debugger, you can step through your code, set breakpoints, and view the call stack, as well as local and global variables, just as you debug Visual Basic code today!

As noted above, T-SQL Debugging is only available with Microsoft SQL Server 6.5 with Service Pack 1 or greater. Therefore, Service Pack 2 is provided in the \Tools\TSQL directory. Service Pack 2 is an “all inclusive” service pack, meaning that it includes all of the fixes found in Service Pack 1.

In addition to the Service Pack, T-SQL Debugging requires additional setup on the server machine in order to facilitate communication between it and the client machine on which you are debugging the stored procedures. (The connection is actually performed through Remote Automation.) Server-side setup for T-SQL Debugging can be found in the \Tools\TSQL directory as well.

Visual Database Tools

Visual Database Tools is a collection of four components that provide the means for graphically interacting with your ODBC data source.

You can access the Visual Database Tools from within the Visual Basic environment to help create and manage data-driven applications that rely on live connections to databases. The Query Designer enables you to use visual tools to build SQL statements that retrieve data or modify the contents of tables. The Database Designer graphically represents tables and their relationships and enables you to create and modify the database objects that your application relies on. All this can be done while you're connected to the underlying database. Thus, you can design, query, and populate your databases from within the design environment that you use to build your application.

By default, Visual Basic Enterprise Edition installs Microsoft Query to support graphically designing queries while using the Connection Query Designer. After installing Visual Database Tools, Microsoft Query is automatically replaced by the Query Designer.

In addition, you can access Visual Database Tools as an add-in. Click Add-Ins from the Add-In Manager menu and choose Microsoft Data Tools.

Setup for Microsoft Visual Database Tools can be found in the \Tools\DataTool directory.

Utilities

License Package Authoring Tool (LPK Tool)

The LPK tool creates license files for all controls on your Web page that require a design-time license to display properly. The LPK tool creates a .LPK file that resides on the Web server and is referenced through an Object tag in your HTML. The .LPK file is never downloaded; Internet Explorer simply references this file for the proper license keys when instantiating controls on a page.

When creating an Internet component download using the Setup Wizard, the Wizard creates a sample HTML page that shows you how to reference the control or ActiveX Document. Included within the HTML is a comment that shows how to use the LPK Object tag if required:

<!-If any of the controls on this page require licensing, you must create a license package file. Run LPK_TOOL.EXE t create the required LPK file. LPK_TOOL.EXE can be found on the ActiveX SDK, http://www.microsoft.com/intdev/sdk/sdk.htm. If you have the Visual Basic 5.0 CD, it can also be found in the \Tools\LPK_TOOL directory.
The following is an example of the Object tag:

<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
   <PARAM NAME="LPKPath" VALUE="LPKfilename.LPK">
</OBJECT>
-->

For more information on license package files, please refer to the ActiveX Software Development Kit (SDK).

Image Editor

The Image Editor is a useful tool for creating bitmaps, icons, and cursors. Image Editor is actually a Win32® sample application compiled and distributed with Visual Basic (which means the source code is available in such places as the MSDN Library).

To install the Image Editor, simply copy the contents of the \Tools\ImagEdit directory to your \Windows directory and run ImagEdit.Exe. A complete Help file is included with this utility.

Tip   If you create a bitmap in Visual Basic using the SavePicture method and attempt to open it in ImagEdit, you may receive an error “XYZ.Bmp is not a valid 3.0-format bitmap file”. The image is actually the correct format; ImagEdit does not support images greater than 255x255 or greater than 16 colors. The error message is misleading; simply use the standard Windows® Paint program to open such an image.

Help Compiler Workshop

Help Workshop is a program that you use to create Help (.hlp) files, edit project and contents files, and test and report on Help files. Help Workshop takes the information in the project (.hpj) file to combine the topic (.rtf) files, bitmaps, and other sources into one Help file that can be viewed using the Microsoft Windows Help program.

The Help Workshop has been updated in Visual Basic 5.0 to support Microsoft Word 97 format .RTF files.

Run Setup.exe from the \Tools\HCW directory and the Help Compiler Workshop will be installed to your computer.

Registration Utilities

The \Tools\RegUtils directory contains three tools for registering in-process ActiveX servers. In-process servers are ActiveX dynamic-link libraries (DLLs) or ActiveX controls.

REGSVR32.EXE

RegServer is a Windows-based program that allows you to register and unregister in-process servers. REGSRVR32.EXE will display dialog boxes indicating whether it was successful unless you use the silent option “/s”.

To register a server, use the following format:

REGSVR32.EXE MyServer.dll 

To unregister a server, use the /u option in the following format:

REGSVR32.EXE /u MyServer.dll

REGOCX32.EXE

RegOCX is a Windows-based program specifically designed for use by Setup programs when installing OCXs, since REGOCX32.EXE does not display confirmation dialogs. To register an OCX you use the following format:

REGOCX32.EXE MyCtrl.ocx

REGIT.EXE

RegIt is a command-line utility that you can use to register one or more in-process servers. RegIt accepts wildcards. For instance, you can use:

REGIT.EXE *.OCX

to register all of the .OCX files in a directory.

To install these utilities, copy the files to a directory on your hard drive. You may want to put these utilities in a directory in your PATH (for example, \Windows\Command) if you use them often enough. You can place a shortcut to these utilities in the \Windows\Send To directory, which lets you right-click on a component and register it automatically. Further, it is also useful to associate the .DLL and .OCX file extensions with REGSVR32.EXE so that you can double-click on DLLs and OCXs to register them.

Resource Compiler

Visual Basic 4.0 brought with it resource files. Resource files are just that, files that contain various resources used by your application, such as strings and images. The Resource Compiler (RC.EXE) can be used to compile your resource scripts into .RES files, which can then be added to your Visual Basic project and accessed through standard Visual Basic methods such as LoadResData, LoadResString, and LoadResPicture.

The most obvious use of resources is localization. By placing all of your strings into a resource file, you can easily localize your application by translating the strings in your resource script, compiling it, and then recompiling your application. No changes to source code are required!

The Application Wizard in Visual Basic 5.0 provides the user with the choice of using Resources for strings. If you choose this option, the wizard will write a resource script for you (.rc), compile it using the Resource Compiler, and add it to your project (look under Related Documents in the Project Window).

A secondary and perhaps more interesting use of resources is to store graphics images. By placing your graphics in a resource file, Visual Basic will load them on demand, improving the performance of your applications.

Visual Basic installs the resource compiler to the \VB\Wizards directory for the Application Wizard. If you want to install it yourself, copy the files from the \Tools\Resource directory to a directory in your PATH (for example, \Windows\Command) if you use them often.

For more information on how to use the Resource Compiler, see RESOURCE.TXT and RC.HLP, found in the \Tools\Resource directory.

Spy Utilities

The Visual Basic 5.0 CD contains a number of “Spy” utilities. These applications are useful for debugging applications and for generally gathering information about a process.

ODBC Spy

ODBC Spy is a utility that allows you to log the ODBC API calls produced by your Visual Basic application. It is useful for tracking down problems in Visual Basic applications that use ODBC drivers to access data. The log produced by ODBC Spy is usually easier to read than the log produced by the ODBC Driver Manager. An additional benefit is that ODBC Spy can log to the screen as well as to a file. Additional documentation for ODBC Spy is included in ODBCSPY.HLP.

Windows 95 Installation

To install on Windows 95, copy all the files in the ODBCSpy directory on the CD to a directory on your hard drive. Then, copy CTL3D32.DLL from the ODBCSpy\Win95 sub-directory to your \Windows\System directory on your hard drive.

Execute ODBCSP32.EXE to start ODBC Spy.

Windows NT Installation

To install on Windows NT®, copy all the files in the ODBCSpy directory on the CD to a directory on your hard drive. Then, copy CTL3D32.DLL from the ODBCSpy\WinNT sub-directory to your \Windows\System directory on your hard drive.

Execute ODBCSP32.EXE to start ODBC Spy.

SpyXX

Spy++ (SPYXX.EXE) is a Win32-based utility that gives you a graphical view of the system's processes, threads, windows, and window messages.

With Spy++, you can:

Please refer to spyxx.help for more information.

Note   This tool requires Microsoft Foundation Class Library (MFC) version 4.2, which can be found in the \Tools\MFC42 directory. Visual Basic 5.0 does not install MFC 4.2, and if you do not have this version of MFC on your computer, an error message will be displayed when you attempt to run this utility. To install MFC 4.2, simply copy the files from \Tools\MFC42 to your \Windows\System directory (or \System32 directory on NT), and then run the tool of your choice.

PSpy

Pspy is a tool to help you locate where DLLs in memory are loaded from—much like WPS.EXE in Windows 3.1. It will help you identify the versions of all DLLs that your program is using and it will provide information on the working set of a process. PSpy requires that Visual Basic is installed.

Installation for users of Windows NT 3.51/4

PSpy will now run from the CD.

If you want to install PSpy to your machine, copy the following files to your \System32 directory:

PERFINFO.DLL
WORKSET.DLL

Copy PSPY.EXE to your hard drive and create a Program Manager icon for it.

Installation for users of Windows 95

Copy the following file to your \System directory:

MEMMON.VXD

Copy the following file to the \System\VMM32 directory:

VMM.VXD

Add the following line to the [386Enh] section of your SYSTEM.INI file:

Device=memmon.vxd

Restart Windows 95.

PSpy will now run from the CD. If you want to install PSpy to your machine, copy the following files to your \System32 directory:

PERFINFO.DLL
WORKSET.DLL

Then copy PSPY.EXE to your hard drive and create a Program Manager icon for it.

PView

PView lets you view and terminate processes on your system. PVIEW.EXE runs under Windows NT and PView95 runs under Windows 95. Under Windows NT 4.0, the Task Manager has most of the same capabilities as PVIEW.EXE.

Copy the appropriate version of PView to your hard drive or run it from the CD.

WSView

The Working Set Viewer lets you view the working wet for a particular process.

To install the Working Set Viewer under Windows 95, copy MEMMON.VXD and PSAPI.DLL from \Tools\Unsupprt\WSView\Win95\ to your Windows 95 system directory. For example (assuming the Visual Basic CD is in drive D):

 cd c:\win95\system
 copy d:\Tools\Unsupprt\WSView\Win95\memmon.vxd
 copy d:\Tools\Unsupprt\WSView\Win95\psapi.dll

Copy \Tools\Unsupprt\WSView\Win95\VMM.VXD to the \VMM32 directory under your Windows 95 system directory. For example:

 cd c:\win95\system\vmm32
 copy d:\Tools\Unsupprt\WSView\Win95\vmm.vxd

Add the following line to your system.ini file in the [386Enh] section:

 Device = memmon.vxd

Reboot Windows 95 and then run WSVIEW.EXE.

Under Windows NT, copy \Tools\Unsupprt\WSView\WinNT\PSAPI.DLL to your \System32 directory and then run WSVIEW.EXE

OLE Tools

The \Tools\OLETools directory contains five tools for working with OLE applications. For more information on all these tools consult OLETOOLS.HLP.

Installation

Copy all the files in the OLETools directory to a directory on your hard drive.

Note   Most of these tools require MFC version 4.2, which can be found in the \Tools\MFC42 directory. Visual Basic 5.0 does not install MFC 4.2, and if you do not have this version of MFC on your computer, an error message will be displayed when you attempt to run one of these utilities. To install MFC 4.2, simply copy the files from \Tools\MFC42 to your \Windows\System directory (or \System32 directory on Windows NT), and then run the tool of your choice.

GuidGen/UUIDGen

Both GUIDGEN and UUIDGEN are tools for generating globally unique identifiers, or GUIDs. GUIDS are commonly used in OLE to identify classes (CLSID) or interfaces (IID.) These utilities are included with Visual Basic for developers who want to generate IDL (Interface Description Language) or ODL (Object Description Language). IDL and ODL are used with the MKTYPLIB.EXE tool (\Tools\Unsupprt\Typlib) to generate type libraries that can be used with Visual Basic.

GUIDGEN.EXE

GUIDGEN is a Windows-based program that generates GUIDs in several different formats. GUIDGEN places GUIDs on the Clipboard so that you can paste them where you need to use them.

UUIDGEN.EXE

UUIDGEN is a command-line utility that also generates GUIDs in different formats. You use UUIDGEN as follows:

UUIDGEN [-isonvh?]
i - Output UUID in an IDL interface template
s - Output UUID as an initialized C struct
o<filename> - redirect output to a file, specified immediately after o
n<number> - Number of UUIDs to generate, specified immediately after n
v - display version information about uuidgen
h,? - Display command option summary

Productivity Tools

API Viewer

The API Viewer application is a tool that provides instant access to thousands of Windows API declares, constants, and structures. For Visual Basic 5.0, the tool has been enhanced to run both as a stand-alone application and as an add-in, integrated into the development environment. Absent from the Visual Basic 5.0 version is the 16-bit API data file, since Visual Basic 5.0 is a 32-bit–only product.

The API Viewer is most useful when run as an add-in. To start the Viewer, click the Add-In Manager from the Add-Ins menu, and select the Visual Basic API Viewer entry. A new menu item is added to the bottom of the Add-Ins menu that brings up the API Viewer.

Search and select the declares, constants, and UDTs required for your application, and automatically insert or drag them into the active module of your project. Also new in this version is the ability to view your selections as line items (as in Visual Basic 4.0) or view full-text versions of your selections.

The API Viewer can be found in the \VB\WinAPI directory and is installed when you choose to install Wizards and Templates during Setup.

Template Manager

The Template Manager is an add-in that adds three new template types to Visual Basic 5.0. With the Template Manager, you can now save and reuse Menu and Code Snippet templates during application development. No longer do you need to recreate the File menu on every form you design in every application you write. Code it once, save it as a Menu template (along with all the supporting code!) and save it as a Template. The next time you begin creating a form that requires a File menu, simply insert it onto the form using the Template Manager.

The Template Manager is not installed with Visual Basic, nor is it a supported feature. To install the add-in:

Copy \Tools\Unsupprt\TmplMgr\TempMgr.Dll to your Visual Basic directory and register it using RegSvr32.exe (found in the \Tools\RegUtils directory). Add the following entry to \Windows\VBADDIN.INI:

"TempMgr.Connect=0"

Finally, create the new Template directories and populate them with the samples found in \Tools\Unsupprt\TmplMgr\Template:

\VB\Template\Code
\VB\Template\Menus
\VB\Template\Controls

You are now ready to run the Template Manager. Start Visual Basic, click Add-In Manager from the Add-Ins menu, and choose Visual Basic Template Manager. Three new menu items will appear under the Tools menu from which you can access your new templates.

Finally, creating new templates is as easy as creating forms. For example, simply create a form with a File menu and all the associated code, and save it to the \VB\Template\Menus directory as “MyFileMenu.Frm”. Now, when you choose Add Menu from the Tools menu, you will see MyFileMenu as one of the options!

Tab Order Sample

The documentation on the Visual Basic 5.0 Extensibility Model makes use of the TabOrder sample application. This sample is an add-in, running within the IDE, that manages the Tab Order of controls on your form! Not only is the sample a great way to learn about the rich Visual Basic extensibility model, it’s a great tool to add to your toolkit. Simply compile the sample into your \VB directory and use it every day.

To fully install the TabOrder sample, you must write an entry (a ProgID) to the VBADDIN.INI, the text file the Add-In Manager uses to load and reference add-ins. Visual Basic 5.0 now has the ability to run procedures through the Immediate Window at design time. The sample has a function called AddToINI that you can run after you have built the project.

  1. Load the \Samples\CompTool\AddIns\TabOrder\TabOrder.vbp project.

  2. Open the Immediate Window (Ctrl+G) and enter “AddToINI” and click Return.

  3. Make the project into TabOrder.DLL and close the project.

  4. Choose the Add In Manager from the Add-Ins menu, select Visual Basic TabOrder Window from the list and click OK.

The TabOrder window will appear, listing all controls on your active form. Notice that this window can be docked and linked just like any other Visual Basic window, and it's all written in Visual Basic.

Setup Toolkit

The Setup Wizard and Toolkit have been shipping with Visual Basic since version 3.0. In Visual Basic 5.0, we have updated the kit to include support for Distributed COM (DCOM) setup, Internet component download, and the creation/usage of dependency files that tell the Setup Wizard what files a component needs in order to be properly installed.

In the \Tools\Cabinets folder on the Visual Basic 5.0 CD you will find run-time and control .cab files used for Internet component download. These .cab files are not digitally signed, so they should be used only for testing Visual Basic 5.0–authored control download. Additionally, these .cab files are not suitable for referencing directly from an HTML page. For example, you cannot point to the Comdlg32.cab supplied on the Visual Basic 5.0 CD directly from an HTML page using the CODEBASE tag.

The latest digitally signed .cab files that can be directly referenced from a CODEBASE tag are available on the Microsoft Web site. To download these .cab files, go to http://www.microsoft.com/vbasic/icompdown/. For more information on the Setup Wizard, digital signing, safety, and licensing, read the file Compdown.doc in the \Tools\Docs directory on the Visual Basic 5.0 CD.

Finally, we have included all of the localized versions of Setup.Exe, the bootstrap (or pre-install files) for the Setup program created by the Setup Wizard. This allows developers distributing their applications in multiple languages to ship completely localized setups.

Dialog Objects

The Microsoft Dialog Automation Objects server is an Automation server that can be used instead of the common dialog control. This server provides all of the functionality of the control and more, yet does not require a form on which to sit. For example, with the Dialog Objects server, you can display Page Setup dialog boxes.

To install the Microsoft Dialog Automation Objects:

  1. Copy DLGOBJS.DLL from \Tools\Unsupprt\Dlgobj to your \Windows\System directory (or \System32 directory on Windows NT).

  2. Register the design-time license by merging the Registry file DLGOBJS.REG into your registry:

    Under Windows NT 4.0 and Windows 95, right-click on \Tools\Unsupprt\DlgObj\DLGOBJS.REG and choose "Merge".

    Under Windows NT 3.51, copy \Tools\Unsupprt\DlgObj\DLGOBJS.REG to your hard drive and merge it into the registry using RegEdt32.Exe.

  3. Register DLGOBJS.DLL by either using RegSvr32.Exe found in \Tools\RegUtils or by pointing to the Project menu in Visual Basic, selecting the References dialog box, browsing for DLGOBJS.DLL, and clicking Open.

  4. Once the DLL is registered, point to the Project menu, open the References dialog box, and select Microsoft Dialog Automation Objects.

Some Tips and Tricks: The Show method of a particular object returns a Boolean, indicating whether or not the user pressed OK or Cancel. The colon (“:”) delimits filters in the File dialog box.

Sample Code

Most sample code is unsupported by Microsoft Product Support, meaning you can use the code, but you do so at your own risk and you can only rely on the comments provided to determine the logic involved. That said, check them out because they are outstanding and demonstrate how to do some pretty amazing things in Visual Basic.

Calendar Control

The Calendar Control sample is a Visual Basic ActiveX control that shows a month-at-a-time view of a calendar. This control by itself is extremely useful for providing an alternate means for entering dates into your application, providing the end user with a familiar metaphor for selecting dates.

This control is completely user-drawn, meaning it is not a composite of other controls—everything within the interface is drawn by the control itself. It demonstrates off-screen painting for flicker-free displays, advanced property pages that embed the control within itself to preview property changes. The Calender Control sample also demonstrates raising multiple user-defined events.

The source code for this project can be found in the \Tools\Unsupprt\Calendar directory.

SysTray Control sample

The Windows 95 interface introduced the system tray, an area of the taskbar that is used to display status information to the user. Typically, one sees the time, the volume control, and perhaps a few other icons, depending upon the software installed.

The SysTray Control sample is an ActiveX control, written in Visual Basic 5.0, that contributes an icon in the SysTray and responds to mouse events on that icon. You can use this control “as-is” and find 101 uses for it, or you can enhance it to fit your own needs.

The control demonstrates the use of the new AddressOf function to subclass the Windows procedure for the control, as well as advanced Windows API techniques. The control provides some interesting properties and events:

Property Description
InTray Lets you put the control in the SysTray and remove it at run time.
TrayIcon Lets you set and retrieve the icon displayed in the tray.
TrayTip Lets you set the tooltip text displayed as the mouse hovers over the icon within the tray.
Events
MouseUp Raised when a mouse button is released over the icon in the tray.
MouseDown Raised when a mouse button is pressed on the icon in the tray.
MouseMove Raised as the mouse is being moved over the icon in the tray.
MouseDblClick Raised when the icon is double-clicked in the tray.

The source code along for the SysTray control can be found in the \Tools\Unsupprt\SysTray directory.

HTTP Explorer

The HTTP Explorer sample application gives a Windows Explorer–style view of any Web site, including all of the documents found on a site, the links from those documents, the HTML source code, and the actual page displayed within an instance of the Internet Explorer WebBrowser control.

This sample application demonstrates how to use the MSInet and the WebBrowser controls. In addition, this is an exciting sample application that quickly provides a map of your Web site.

You can find the source code for the HTTP Explorer sample application in \Tools\Unsupprt\HTTPExpl.

Screen Saver

The Screen Saver sample application is a Visual Basic–authored screen saver that runs under Windows 95 or Windows NT 4.0. It has a custom properties page where you can set various properties of the display and it shows you how to preview the screen saver from the Control Panel applet.

Above and beyond the fact that this sample demonstrates advanced graphics routines performed in Visual Basic, it is simply fun to watch. Many members of the Visual Basic team at Microsoft run this utility as their primary Screen Saver.

The source code for the Screen Saver sample is in \Tools\Unsupprt\Ssaver

Internet Voice Chat

Ever wanted to talk with someone via the Internet? This Visual Basic sample will let you do just that! The Internet Voice Chat application uses streaming through sockets to accomplish this amazing feat. With this sample, you can connect to any computer on your network or on the Internet and carry on a conversation, as long as both computers have a sound card and microphones.

The Internet Voice Chat application actually consists of two projects, a WaveStream in-process server that handles the streaming of sound through the Windows socket layer, and a graphical front end that lets you dial up a particular computer. In fact, you can talk to multiple people at the same time.

The source code for the Internet Voice Chat application can be found in the \Tools\Unsupprt\Voice directory. Compile the WaveStrm project into your \Windows\System directory first and then open the VchatApp application.

Shell Link and Icon Handler

The Shell Link and Icon Handler samples (\Tools\Unsupprt\ShellLnk and \Tools\Unsupprt\IHandle) demonstrate advanced COM interface manipulation.

Both samples demonstrate how to get access to a COM object or interface inside a DLL that does not contain Typelib information. This is done by creating a IUnknown pointer to an object created from a GUID (CLSID) and querying the interface of that COM object.

The samples include type libraries that describe the base class for various interfaces found in the Windows 95/Windows NT 4.0 shell (shell32.dll). These type libraries can be referenced from a Visual Basic project and the interfaces can subsequently be accessed by your application.

The Shell Link sample itself demonstrates how to add links to directories, the Desktop, and the Start menu—all with Visual Basic code.

OLE Messaging

The Microsoft OLE Messaging Library exposes messaging objects for use by Visual Basic applications.

The OLE Messaging Library lets you quickly and easily add to your Visual Basic application the ability to send and receive mail messages and to interact with folders and address books. You can create programmable messaging objects and then use their properties and methods to meet the needs of your application.

The Microsoft OLE Messaging Library does not represent a new messaging model. It represents an additional interface to the Messaging Application Programming Interface (MAPI) model, designed to handle the most common tasks for client developers using Visual Basic.

Contained within the \Tools\OleMsg directories are the following components:

Repository Sample

The Microsoft Repository is installed with Visual Basic, but the add-in to access the Repository is not enabled. If you install a third-party development tool that is an extension of the Visual Basic Integrated Development Environment (VBIDE) and uses Microsoft Repository, the Repository add-in for Visual Basic will be activated when you install the third-party tool. If you are not using such a tool, we don't recommend that you activate the Repository add-in for Visual Basic. Doing so will introduce overhead that provides no benefit to you.

The \Tools\Repostry directory and its subdirectories contain sample Visual Basic 5.0 applications that demonstrate how to write code that uses the Repository.

Browser Sample

The Browser sample application demonstrates how to use the Repository to display Visual Basic 5.0 project information (MDO objects).

The browser displays MDO objects, relationships, and properties. The relationships are displayed as folders in the tree view. To see the properties, you must select an object, then click the right mouse button. The property display is generic. This means that if you create a new property type, you will see it in the properties window. However, the relationships are hard-coded. If you wish to display your relationship types in the browser tree view, you must modify the browser code to include your relationship types.

File System Sample

The File System sample application demonstrates how to customize the repository to support objects that you define.

Controls

The \Tools\Controls directory contains all of the ActiveX Controls that shipped with Visual Basic 4.0 Professional and Enterprise Editions, which are no longer shipping with Visual Basic 5.0. These controls have either been replaced by a new control (i.e. MsFlxGrd.Ocx replaces Grid32.OCX), or their functionality has been rolled into the Intrinsic controls:

AniBtn32.ocx
Gauge32.ocx
Graph32.ocx
Gsw32.EXE
Gswdll32.DLL
Grid32.ocx
KeySta32.ocx
MSOutl32.ocx
Spin32.ocx
Threed32.ocx

The \Tools\Controls\BiDi directory contains a bi-directional version of Grid32.Ocx.

If you have Visual Basic 4.0 Professional or Enterprise Editions installed on your machine, you should already have these ActiveX controls available to you in Visual Basic 5.0.

Graph32.ocx has been updated to work properly in Visual Basic 5.0 and, as before, it requires two additional support files: gsw32.exe and gswdll32.dll. You must place the three files together in the \Windows\System directory or the control will not function properly.

If you do not have these controls and wish to use these in Visual Basic 5.0, you can install them by following these steps:

  1. Copy all of the files in this directory to your \WINDOWS\SYSTEM directory.

  2. Register the controls by either browsing to them in Visual Basic itself, or manually register them using RegSvr32.Exe, which can be found in the \Tools\RegUtils directory. The command line is:

    regsvr32.exe grid32.ocx

  3. Register the design-time licenses for the controls. To do this, merge the vbctrls.reg file found in this directory into your registry. You can merge this file into your registry using RegEdit.Exe (Windows 95 or Windows NT 4.0) or RegEd32.Exe (Windows NT 3.51):

    regedit vbctrls.reg

Service Packs

Microsoft Windows NT 3.51 Service Pack 5

Visual Basic 5.0 runs on Windows 95, Windows NT 4.0, and Windows NT version 3.51 with Service Pack 5 (SP 5). SP 5 for Windows NT 3.51 can be found in the \Tools\NT351SP5.a directory.

Microsoft SQL Server 6.5 Service Pack 2

To use T-SQL Debugging, you must have Microsoft SQL Server version 6.5 with Service Pack 1 or greater. SP 2 for SQL Server 6.5 can be found in the \TSQL\SQL65.SP2 directory. Service Pack 2 is all-inclusive, which means that it contains fixes found in Service Pack 1 as well.

Microsoft Windows NT 4.0 Service Pack 2

Microsoft highly recommends installing Service Pack 2 (or greater) for Windows NT 4.0 when running Microsoft Visual Basic 5.0 on Windows NT 4.0. In fact, the setup program created by the Setup Wizard checks for Service Pack 2 on Windows NT 4.0 and warns end users that they should have the Service Pack or their application may not run properly.

Microsoft Distributed COM for Windows 95

Finally, Distributed COM (DCOM) is standard with Windows NT 4.0, yet requires an upgrade to Windows 95 in order to communicate via DCOM between the two platforms. The \Tools\Dcom95 directory contains the DCOM upgrade for Windows 95.

Documentation

A common user request has been to include the documentation in electronic format with the product. All of the documentation found in Books Online can be found in the \Tools\Docs directory. In addition, you can find the following information in the Tools directory:

Internet Component Download (\Tools\Docs\CompDown.Doc)

If you are writing ActiveX controls or documents that will be automatically downloaded via Microsoft Internet Explorer, then this document is a must-read. It gives details about how Internet component download works, how the Setup Wizard generates Cabinet files and HTML, and how to create your own components for download by hand.

Creating DLLs for Visual Basic (\Tools\Docs\VB5DLL.Doc)

This document discusses writing standard Windows-based DLLs for Visual Basic applications. It goes into great detail on calling conventions, passing parameters, ANSI/UNICODE conversions, and using Type Libraries. Note that this is a document for advanced programmers, yet everyone should read it because it gives great insight into the workings of Visual Basic.

WebBrowser ActiveX Control Online Help (\Tools\Unsupprt\WebBrwsr\WebBrows.Hlp)

The WebBrowser ActiveX control ships with Microsoft Internet Explorer version 3.0. In fact, the entire viewing area within Internet Explorer is the WebBrowser control. Since it is an ActiveX control, you can add it to your project and place it on a form, just like any other intrinsic or ActiveX control. Imagine creating your own Web browser in Visual Basic!

Although the Online Help for this control does not ship with Internet Explorer, it can be found here in the \Tools\Unsupprt\WebBrwsr directory.

MCIWinDx Control Documentation (\Tools\Unsupprt\MCIWnDx)

After installing Books Online with Visual Basic 5.0, you will find the MCIWnDx control in your Components list. MCIWnDx.Ocx is a 32-bit ActiveX control wrapper around the Windows MCIWnd multimedia window class. The purpose of this control is to allow application developers to easily add multimedia functionality to their applications.

Word Viewer (\Tools\Docs\wd95vw71.exe)

If you don’t have Microsoft Word or a compatible word processor that can open documents formatted in Microsoft Word, the Word Viewer application is included for your use. Simply run wd95vw71.exe and the Word Viewer will be installed.

Additional Resources

For more information, visit these exciting Web sites: