0% found this document useful (0 votes)
104 views

Dan Appleman's Developing ActiveX Components With Visual Basic 5.0

vb6

Uploaded by

Romancing Love
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views

Dan Appleman's Developing ActiveX Components With Visual Basic 5.0

vb6

Uploaded by

Romancing Love
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Dan Appleman's

Developing ActiveX Components


with Visual Basic 5.0

A Guide to the Perplexed

Dan Appleman

CONTENTS

Introduction

● What's in A Guide to the Perplexed?


❍ On Concepts

❍ On My Target Audience

❍ On Approach

● On Style
● On Scope
● Final Comments
❍ On Microsoft

❍ On Free Software

❍ On Desaware

❍ On E-mail

❍ On Updates and Corrections

PART 1 Core Technologies

● ActiveX Myths
● ActiveX: A Historical (but Technical) Perspective
● Objects and Visual Basic
● The Component Object Model: Interfaces, Automation, and
Binding
● Aggretion and Polymorphism
● The Life and Times of an ActiveX Component
● ActiveX Components: What's in a Name?

Chapter 1 ActiveX Myths

Chapter 2 ActiveX: A Historical (but Technical) Perspective

● The Application-Centric Environment


❍ The Data-centric Environment

● The Road to ActiveX


❍ DDE
❍ OLE 1.0
❍ OLE 2.0

❍ Enter the VBX

❍ Enter Visual Basic 4.0

● ActiveX: Is It Technology or Is It Marketing?

Chapter 3 Objects and Visual Basic

● The Theory of Object-Oriented Programming


● Objectless Programming
❍ Has This Ever Happened to You?

● Once Again, with Objects


❍ Minor Changes, Revisited

● The Theory of Object-Oriented Programming Revisited

Chapter 4 The Component Object Model: Interfaces, Automation, and Binding

● Characteristics of COM Objects


❍ Inside COM

● The Sunday COMics


❍ Interface Names and the Nature of the Contract

● Automation (Dispatch) Interfaces and Binding


❍ Performance Impacts of Binding

Chapter 5 Aggregation and Polymorphism

● Back to Binding
● An Object as Object
● Aggregation
● An Object Implements
❍ Trade-offs

Chapter 6 The Life and Times of an ActiveX Component

● Objects: Are They Real or Are They Memory?


❍ An Interlude

● Process Spaces: The Final Frontier


❍ Back to COM Objects

● The Life Cycle of a DLL Object


❍ A Look Behind the Scenes

● The Life Cycle of an EXE Object


● Performance Issues

Chapter 7 ActiveX Components: What's in a Name?

● ActiveX Controls and Documents


❍ ActiveX Controls

❍ ActiveX Documents

● ActiveX Trade-offs
❍ Classes
❍ ActiveX DLLs (Code Components) (In Process)
❍ ActiveX EXE Servers (Out of Process)
❍ ActiveX Controls
❍ ActiveX Documents (Doc Objects)

PART 2 Code Components

● The Project
● Creating and Testing Components
● Code and Classes-Beyond the Manuals
● Events
● Collecting Objects
● Object Lifetime
● Multithreading
● Bringing It All Together: The StockQuote Server

Chapter 8 The Project

● Project Overview
❍ Designing the Object Model

❍ Choosing the Project Type: EXE or DLL

● Instancing
❍ Private

❍ PublicNotCreatable

❍ SingleUse

❍ MultiUse

❍ GlobalMultiUse

❍ GlobalSingleUse

❍ Variations on Instancing

❍ Impact of Instancing on Sharing Class Modules Between Projects

● Project Properties
❍ General Property Settings

❍ Make Property Settings

❍ Application Title

❍ Application Icon

❍ Compile Property Settings

❍ Component Property Settings

● Moving On

Chapter 9 Creating and Testing Components

● A Quick Look at the User Interface


❍ It's Not a Form, It's a Designer

● Creating and Testing ActiveX Components


❍ The Ideal Test Environment

❍ A Component is Born

❍ The Component Compiled

❍ Tips and Techniques


● Referencing and Reference Order
● Error Handling
❍ OLE Error Handling and "Basic" Error Handling?

❍ EXE Server Components

❍ Recommendations and Trade-offs

Chapter 10 Code and Classes-Beyond the Manuals

● Methods and Properties


❍ Get, Set, Let-Go!

❍ More on Properties

❍ Is It a Property or Is It a Method?

❍ Parameterized Properties

❍ Properties That Are Objects

❍ Overloaded Properties and Functions

❍ A Slightly Quirky Way of Overloading Properties

❍ Evil Type Coercion

❍ Option Explicit

❍ More about Variants

❍ Optional Parameters and Parameter Arrays

❍ Parameters That Handle Large Blocks of Data: Arrays and User-Defined Types

● Procedure Attributes
❍ Description

❍ Help Context ID

❍ Procedure ID

❍ Hide This Member

● Object Procedures: Public, Private, and Friend


❍ Public Is As Public Does

❍ Scoping Rules

● Selected Topics
❍ Enums

❍ To Wiz or Not To Wiz

Chapter 11 Events

● A Method By Any Other Name


❍ OLE Callbacks

● Back to COM
❍ Creating Separate Events with OLE Callbacks

● Combining OLE Callbacks and OLE Events

Chapter 12 Collecting Objects

● The Characteristics of Collections


❍ Evaluation Criteria

● The Three Four Approaches to Exposing Collections in Components


❍ The House of Straw

❍ The House of Sticks

❍ The House of Bricks

❍ The Custom Home


Chapter 13 Object Lifetime

● Referencing
❍ What Happens When…?

● Circular References
❍ Object Model Dilemmas

❍ Enforcing Object Model Rules

❍ Dealing with Circular References

❍ Initialization Events

❍ Termination Events

❍ Unkillable Applications

❍ Private Objects

❍ Track Your Objects

❍ Don't Stop Your Application

Chapter 14 Multithreading

● On Threads and Processes


❍ Multithreading

❍ Multithreading Pitfalls

● Multithreaded Components
❍ On Threads and Objects

❍ Scoping Revisited

● Testing and Debugging Multithreaded Components


❍ Logging

❍ Debug Monitor

● Multithreading Examples
❍ The Proof Is in the Timing

❍ Let the Testing Begin

● Background Operations Revisited


❍ Multithreading Is Not Magic

❍ You Have More Control Than You Think

Chapter 15 Bringing It All Together: The StockQuote Server

● Top-Down Design
❍ High-Level Design Review

❍ Low Level Design Review

● Implementation
❍ Everything You Need to Know about HTML

❍ Talking to the Net

❍ The Quote Engine

❍ Parsing HTML

❍ Collecting HTML Elements

❍ The StockQuote Object, At Last

❍ On Referencing

❍ The StockMon.vbp Project


PART 3 ActiveX Controls

● ActiveX Control Fundamentals


● The UserControl Object
● The Extender and Ambient Objects
● The Wondreful World of Properties
● Property Pages and Others
● ActiveX Controls and the Internet
● Advanced Techniques

Chapter 16 ActiveX Control Fundamentals

● Things Every Programmer Should Know about ActiveX Controls before He or She Writes a Single Line of Code
❍ ActiveX Controls Are Platform-Limited

❍ ActiveX Control Containers Are Not All the Same

❍ VB-Created Controls Do Have Limitations

● Design Time versus Runtime versus Design Time versus Runtime


❍ A Matter of Perspective

❍ A Cacophony of Objects

● The Three Four Models for Control Creation


❍ Enhance an Existing Control

❍ Build a Control from Constituent Controls

❍ User-Drawn Controls

❍ Create Your Own Window

Chapter 17 The UserControl Object

● Lifetime-Related Events
❍ The Initialize Event

❍ The Terminate Event

● Introduction to Property Persistence


❍ On Default Values

❍ The InitProperties Event

❍ The ReadProperties Event

❍ The WriteProperties Event

❍ The PropertyChanged Method

● Siting and Display Events and Properties


❍ The Resize Event

❍ The Show and Hide Events

❍ The Paint Event

❍ The InvisibleAtRuntime Property

● Focus Events and Properties


❍ The GotFocus Event

❍ The LostFocus Event

❍ The EnterFocus and ExitFocus Events

❍ The CanGetFocus Property

❍ The AccessKeys Property

❍ The ForwardFocus Property

❍ The AccessKeyPressed Event


❍ Working with Access Keys
❍ The DefaultCancel Property
● Transparent Controls
❍ Transparent Constituent-Based Controls

❍ Oddly Shaped Controls

❍ Label Style-Based Controls

❍ Bitmap-Based Controls

● Other Properties and Methods


❍ The Alignable Property

❍ The ControlContainer and ContainedControls Properties

❍ The EditAtDesignTime Property

❍ The Enabled Property

❍ The EventsFrozen Property

❍ The PaletteMode Property

❍ The Parent Property

❍ The ParentControls Property

❍ The Public Property

❍ The RightToLeft Property

❍ The ToolBoxBitmap Property

Chapter 18 The Extender and Ambient Objects

● The Extender Object


❍ Impact of Scoping Rules

❍ Accessing Extender Properties

❍ Control Dependencies

❍ Container Dependencies

● Ambient Properties
❍ Specific Properties

❍ Strategies for Using Ambient Properties

Chapter 19 The Wonderful World of Properties

● Property Data Types


❍ Variants

❍ OLE_COLOR

❍ OLE_TRISTATE

❍ OLE_OPTEXCLUSIVE

❍ Enumerated Types

❍ Pictures and Fonts

● Property Procedures
❍ Using ByVal with Property Let Functions

❍ Raising Errors

❍ Runtime and Design-Time Characteristics

● Control Procedure Attributes


❍ Procedure ID

❍ Use This Page in Property Browser

❍ Property Category

❍ Don't Show in Property Browser

❍ User Interface Default

● Custom Objects
❍ The clsMyObject Fraction Object

❍ The Property Procedures


❍ Introduction to Property Pages

● Persistence
❍ Mapping Properties

❍ Self-Persisting Objects

❍ We're Off To See the Wizard

❍ Asynchronous Persistence

❍ Updating Controls

● DataBinding
❍ The Easy Way

❍ The Hard Way

Chapter 20 Property Pages and Others

● Property Page Fundamentals


❍ Property Page Properties

❍ Property Page Events

● Property Page Techniques


❍ The PropPageA1 Property Page

❍ The PropPgT2.vbp Project

● About Boxes and Others

Chapter 21 ActiveX Controls and the Internet

● The HyperLink Object


● ActiveX Controls on Web Pages
● Downloading, Security, and Signing
❍ ActiveX Controls and Security

❍ The SandBox Approach

❍ The "Trust Me" Approach

❍Safety ≠ Signing
❍ Distributing and Downloading ActiveX Controls

❍ Marking Controls As Safe

❍ Signing Controls

● The dwBanner Control


❍ Conclusion

Chapter 22 Advanced Techniques

● Visual Basic versus Visual C++


❍ Visual Basic's "Limitations"

● Overview of Windows Messaging


❍ What Is a message?

❍ What Happens When a Window Is Created?

❍ What is Subclassing?

❍ What Is a Windows Hook?

● Messaging Examples
❍ Advanced Keystroke Handling

❍ Managing Update Areas

● A Tale of Four Listboxes


❍ A Constituent-Based Control

❍ A User-Drawn Control

❍ A Better User-Drawn Control


❍ A Custom Window-Based Control

PART 4 ActiveX Documents

● ActiveX Document Fundamentals


● ActiveX Documents and the Internet

Chapter 23 ActiveX Document Fundamentals

● What Is an ActiveX Document?


❍ ActiveX Documents and ActiveX Controls

● ActiveX Document Programming


❍ Should You Use a DLL or an EXE Server?

❍ ActiveX Document Display

❍ The Life and Times of an ActiveX Document

❍ Versioning

❍ Containers

❍ Menus

❍ Error Checking

● The UserDocument Object


❍ Ambient and Extender Properties

❍ Parent and Other Client Properties

❍ Property Persistence

❍ Tips and Tricks

Chapter 24 ActiveX Documents and the Internet

● The Realty ActiveX Document


● ActiveX Documents and HTML

PART 5 Selected Topics

● Versioning
● Licensing and Distribution

Chapter 25 Versioning

● Version Resources
● Version Compatibility
❍ Inside Binary Compatibility

❍ Creating New Interfaces

❍ Conclusion
Chapter 26 Licensing and Distribution

● ActiveX Control Licensing


● Alternative Licensing Approaches
● Closing Note

Credits

HTML conversion by :
M/s. LeafWriters (India) Pvt. Ltd.
Website : http://leaf.stpn.soft.net
e-mail : [email protected]

Publisher Stacy Hiquet


Associate Publisher Steven Sayre
Acquisitions Editor Lysa Lewallen
Development/Copy Editor Candace Crane
Technical Reviewer Leslie Taylor
Production Editors Barbara Dahl and Edith Rex
Proofreader Jeff Barash
Cover Illustration and Design Magan Gandt
Technical Illustration Mina Reimer
Book Design Gary Suen
Page Layout Bruce Lundquist
Indexer Valerie Robbins

Copyright © 1997 by Macmillan Computer Publishing USA. All rights reserved.

All other product names and services identified throughout this book are trademarks or registered trademarks of their respective
companies. They are used throughout this book in editorial fashion only and for the benefit of such companies. No such uses, or the
use of any trade name, is intended to convey endorsement or other affiliation with the book.

No part of this publication may be reproduced in any form, or stored in a database or retrieval system, or transmitted or distributed in
any form by any means, electronic, mechanical photocopying, recording, or otherwise, without the prior written permission of
Macmillan Computer Publishing USA, except as permitted by the Copyright Act of 1976, and the End-User License Agreement at
the back of this book, and except that program listings may be entered, stored, and executed in a computer system.

EXCEPT FOR THE LIMITED WARRANTY COVERING THE PHYSICAL DISC PACKAGED WITH THIS BOOK AS PROVIDED IN
THE END-USER LICENSE AGREEMENT AT THE BACK OF THIS BOOK, THE INFORMATION AND MATERIAL CONTAINED IN
THIS BOOK ARE PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WITHOUT
LIMITATION ANY WARRANTY CONCERNING THE ACCURACY, ADEQUACY, OR COMPLETENESS OF SUCH INFORMATION
OR MATERIAL OR THE RESULTS TO BE OBTAINED FROM USING SUCH INFORMATION OR MATERIAL. NEITHER
MACMILLAN COMPUTER PUBLISHING USA NOR THE AUTHOR SHALL BE RESPONSIBLE FOR ANY CLAIMS ATTRIBUTABLE
TO ERRORS, OMISSIONS, OR OTHER INACCURACIES IN THE INFORMATION OR MATERIAL CONTAINED IN THIS BOOK, AND
IN NO EVENT SHALL MACMILLAN COMPUTER PUBLISHING USA OR THE AUTHOR BE LIABLE FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF SUCH INFORMATION OR MATERIAL.

You might also like