You use class modules to implement your own custom object variable types in VB.
Just as VB provides the programmer with TextBox, Form, CommandButton, or RecordSet object types,
so you can provide other programmers (or yourself ) with, say, Employee, FileLocation, or other
object types. And just as the predefined object types have their particular properties, events,
and methods, so can you define custom properties, events, and methods for your custom objects.
Each custom object type that you wish to define must have a class module
behind it. You can use class modules in two different environments:
As part of an ActiveX component server. As part of a server, your class gets registered
in the Windows Registry and other applications can create object instances of it.
As part of a standard EXE. Code in the rest of the application outside the class
module can declare and manipulate object variables based on the class modules you
provide within the application.
The following subsections concentrate on the basics of creating and manipulating a
class in a standard EXE. Later sections extend the use of classes to the world of COM components.