- VB uses the following mechanisms to implement objects and classes:
- Type libraries store a group of classes together.
- Object browsers are used to view type libraries.
- References in a project are type libraries that your project has accessed.
- A container is any object that can have other objects in it. EG:
- An OLE container (like a Microsoft Word document) may have OLE components (like a Microsoft Excel document).
- An ActiveX container (like a browser) may have ActiveX controls (like a date picker).
- A class can be data aware.
- A class is said to be a data consumer if the class can bind directly to an external source of data.
- A class is a data source/provider if the class can take data from an external source and provide it to other objects.
- If you make your object variable as Object and then later set the object variable to a specific object type, you can determine the object type by using the TypeName function. EG:
lngDataTypeOfObject = TypeName(objAnyObject)
- OOP (Object Oriented Programming) is concerned with building object-based component software (eg use C++ to make a component). ActiveX is concerned with combining object-based component software (eg use VB).
- If the object you are using is one of several, you may programmatically make calls to different methods or properties by utilizing the CallByName function. EG:
CallByName Text1, "MousePointer", vbLet, vbCrosshair
Result = CallByName (Text1, "MousePointer", vbGet)
CallByName Text1, "Move", vbMethod, 100, 100
- You can perform multiple actions upon a single object by using the With...End With statement. EG:
With obj
.Height = 32
.Run
End With
- Me is a VB keyword that is available in all class modules. It is an object variable equivalent to the current instance of the class.
Page Modified: (Hand noted: 2007-09-24 20:00:30Z) (Auto noted: 2007-11-17 06:36:54Z)