VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

You are here: Visual Basic > Advanced VB6 tutorial > Chapter 12

The Uses of Class Modules

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.



<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © | All Rights Reserved