ica" size="2">

ActiveX Components

Most of this book is about one big component called VBCore. You can think of VBCore.DLL as an extension of the Visual Basic library. It extends and wraps the Windows API. It adds useful functions not provided by Visual Basic. It encapsulates common functionality in classes and global objects. Most of the sample programs don’t do real work themselves; they just provide a user interface to illustrate features of VBCore.

At last count, VBCore consisted of 42 classes, 30 global classes, 8 interfaces, 9 standard modules, and 1 resource file, but by the time you read this it will probably have learned to reproduce itself without human intervention. A few of the areas covered include file system control; registry management; API wrappers for windows, processes, and device contexts; data structure encapsulation; bit and byte manipulation; error handling; sorting; random number generation; and animation. I can’t believe I wrote the whole thing. Chapter 5 describes some of the architectural issues that went into the design of VBCore.

Although VBCore is the heart of the book, I provide several other ActiveX DLL and EXE components:

Component Description
VisualCore.DLL Contains the following public classes that wrap forms: CColorPicker, CAbout, and COpenPictureFile. These classes were originally in VBCore, but when I changed VBCore to work for Unattended Execution, I had to move all classes with a user interface into a separate DLL. VisualCore depends on VBCore, but not vice versa. Chapter 11 tells why I made this choice.
SubTimer.DLL Contains the CTimer class (designed to replace the Timer control) and has an ISubclass interface and global functions that simplify subclassing windows. I moved the code out of VBCore into a separate component to avoid debugging problems that occur with uncompiled subclassing and timer code. Also, some programmers might find the code useful without the additional overhead of VBCore. Chapter 6 describes these issues. VBCore uses SubTimer, but SubTimer can also stand alone.
Notify.EXE Encapsulates file system notification through the CNotify class and the IFileNotifier interface. The class resides in an EXE server so that its operation won’t interfere with or affect the performance of clients.

Table A. Hardcore DLL and EXE components.

This isn’t a book about control development. In fact, you’ll see frequent complaints about controls that I don’t think should be controls. But if you really need a visual component, a control is the best way to provide it. I provide the following controls:

Control Description
XEditor Turns a rich text box into a real editor. You provide the user interface. XEditor provides the editing features.
XListBoxPlus My idea of what a ListBox ought to be. It sorts every which way, gives you collection-like features, and does command completion.
XDropStack Provides a visual list of most recently used items—like the drop-down list in Visual Basic’s Find dialog box.
XPictureGlass Provides a transparent PictureBox control with only 4 lines of new code.
XColorPicker Gives your applications a color palette like the one that drops down in the Visual Basic Properties window.

Table B. Hardcore controls.