Mapping the Visual Basic 4.0 Object: VB 4.0

Ken Lassesen

Microsoft Developer Network Technology Group

January 31, 1996

Click here for a diagram of the Microsoft Visual Basic object in various graphics formats.

Abstract

This article presents a graphic map of the Microsoft® Visual Basic® object (VB 4.0), showing its properties, methods, and objects. This map represents the Visual Basic application, excluding controls.

The Microsoft Visual Basic 4.0 Object

The Microsoft® Visual Basic® object (VB 4.0) is the OLE Automation object that is the core of Visual Basic applications. This object is private, although technically it can be made public and exposed by an application. No element of this object should ever be made public in a production or distributed system. Visual Basic is composed of several OLE Automation servers, of which this is one. The other components are controls, the Visual Basic for Applications object library, and the Standard OLE Types object library. Extended maps for the latter two appear in articles listed in the bibliography.

Figure 1 shows the relationship between objects as described by the Object Browser in Visual Basic. A map serves as a good learning aid and a quick reference for developers. After producing a map, I found that it was easy to work with the objects: I just post the three appropriate extended maps for Visual Basic on my wall for quick reference, which is a lot faster than clicking objects in a Help file one by one to discover their properties and methods.

I have included the two most common graphics formats—encapsulated PostScript™ (.EPS) and Windows® metafile (.WMF)—as well as a copy of my original ShapeWare™ Visio™ version 4.0 file (.VSD). The first two formats can be opened and the maps printed across multiple pages using Microsoft Excel or a commercial graphics application such as Adobe™ PageMaker™, CorelDRAW™, or Microsoft Publisher. The original Visio file is included for those who wish to modify the diagram.

Figure 1. Map of the Microsoft Visual Basic 4.0 object

This map excludes all of the form controls built into Visual Basic. These controls and OCX-based controls will be covered in an upcoming series of maps on controls. The Visual Basic type library (VB32.OLB) is slightly different from the map because some collections are omitted in it.

Object Definitions

The objects in Figure 1 are defined in Table 1. The objects are listed in the same sequence as they appear on the map.

Table 1. Object Definitions

  Object Definition
Global object Reports information about the Visual Basic application (not the IDE).
App object Determines or specifies information about the application's title, the path and name of its executable file and Help files, and whether or not a previous instance of the application is running.
Clipboard object Provides access to the system Clipboard.
Screen object Provides information about the screen display that the application is running on and controls the mouse pointer outside the application's forms at run time.
Printers collection Contains information about all of the available printers on the system.
Printer object Represents a system printer.
Forms collection Contains items that represent each loaded form in an application. The collection includes the application's multiple-document interface (MDI) form, MDI child forms, and non-MDI forms.
Form object Is a window or dialog box that makes up part of an application's user interface. It does not include the MDI form.
MDIForm object Acts as the background of an application and is the container for Form objects that have their MDIChild property set to True.
Controls collection Represents each control and menu on a form, including elements of control arrays and menu arrays.
Menu object Includes commands, submenus, and separator bars that appear on the application menu bar.

Bibliography

Lassesen, Ken. "Mapping the Standard OLE Types Object Library: StdType 1.0." (MSDN Library, Technical Articles)

Lassesen, Ken. "Mapping the Visual Basic for Applications Object Library: VBA 2.2." (MSDN Library, Technical Articles)

Professional and Enterprise Editions of Visual Basic 4.0, "Visual Basic Books Online."