Course Audience
This course provides a thorough introduction to COM and ActiveX programming using Visual Basic. Because of its ease of use and very strong tool support, Visual Basic is the language of choice for many applications in the Microsoft Windows environment. Visual Basic also has extensive support for COM, OLE and ActiveX.
Course Description
This course covers the concepts of COM, the implementation of both COM servers and clients, and ActiveX controls. The course emphasizes the conceptual underpinnings of COM programming using Visual Basic, laying a firm foundation for the effective use of this technology in application development. The course runs on Visual Basic 5.0 or 6.0.
The course begins with an exploration of object-oriented concepts, based on a running system supporting customers and merchants. Objects are introduced as an effective design tool for modeling such a system. There is then a discussion of the use of Visual Basic in object-oriented programming. Visual Basic supports abstraction, encapsulation, interface inheritance, and polymorphism. It also supports code reuse through containment and delegation. Then COM is introduced as the mechanism to extend object oriented programming across component boundaries. Components can be implemented in-process (as a DLL) or in a separate process (as an EXE). The basic structure of COM is explained, including vtable and dispatch interfaces, the use of the Registry, type libraries, events, collections and error processing. ActiveX controls are covered.
Prerequisites
The student should have a fundamental knowledge of Visual Basic, and some experience with the Visual Basic 5.0/6.0 IDE would be helpful. The course is suitable for a VB programmer who wishes to learn the object-oriented features of the language. The course will also work for a programmer familiar with an object-oriented language like C++ but who has only a little previous exposure to Visual Basic.
TOPICS COVERED IN LECTURE & LAB
Object-Oriented Programming Using Visual Basic
Introduction to Objects
- What is an Object?
- Abstraction
- Encapsulation
- Classes and Instances
- Interfaces
- Relationships
- Inheritance and Code Reuse
- Polymorphism
Using Objects in Visual Basic
- Properties
- Methods
- Events
- Built-in Objects
- Adding Properties and Methods
- Using External Objects
- Object Browser
- Hierarchical Object Models
Implementing Objects in Visual Basic
- Modules
- Private and Public
- Encapsulation
- Class Modules
- Instantiation
- Object Creation and Destruction
- Methods
- Properties
- Let and Set
Events
- Event Interfaces
- Specifying an Event
- Raising an Event
- Handling an Event
- Encapsulating the VB Timer
|
Interfaces and Containment
- Interfaces
- Implements Keyword
- Multiple Interfaces
- Using Multiple Interfaces
- IS-A and HAS-A Relationships
- Containment/Delegation
- Visual Basic Class Builder
Polymorphism
- Polymorphism
- Abstract Classes
- Implementing Polymorphism
- Using Polymorphism
Variants and Collections
- Variants
- Type Conversion
- Type Information
- Collections
- Indexes and Keys
- For Each Loops
- Collections of Objects
COM Programming Using Visual Basic
Introduction to Components
- Components and Objects
- Local/Remote Transparency
- Component Technologies
- Components in Visual Basic
- ActiveX DLLs and EXEs
- Private and Public Class Modules
Component Object Model
- COM and Visual Basic Object Models
- Interfaces
- Globally Unique Identifiers
- IUnknown
- Interface Negotiation
- Reference Counting
- Object Creation and Destruction
- Multiple Interfaces in Visual Basic
- Instancing Property
Type Libraries
- Type Information
- Use of Type Libraries by Visual Basic
- OLE/COM Object Viewer and Object Browser
- Interface Definition Language
- Default Interface
- Creating Type Libraries
COM and the Registry
- Windows Registry
- Registry Editor
- Registry Entries for COM Components
- Self-Registration
- Version Compatibility
Error Handling
- COM Interfaces for Error Handling
- Visual Basic Exception Processing
- Err Object
- Handling Errors
- Raising Errors
Automation and Late Binding
- Automation and Dispatch Interfaces
- CreateObject
- Early, Late and Dispid Binding
- Using Objects with VBScript
- Events
ActiveX Controls
- Methods, Properties and Events
- Stock Properties and Ambient Properties
- Property Persistence
- Using ActiveX Controls
- Creating Controls Using Visual Basic
|