Bob Swart is a professional software developer and free-lance technical author using Borland Pascak, C++, and Delphi. In his spare time he likes to watch video tapes of Star Trek The Next Generation with his 1-year-old son Erik Mark Pascal.
Windows Custom Controls nowadays come in (at least) two flavors: standard custom controls and VBX-style custom controls. Windows Programming Power with Custom Controls covers both flavors and is intended for two groups of people: users and designers/programmers of custom controls. You don't have to be an experienced Windows programmer to learn what custom controls are or how to use them. The book explains in-depth the history of standard and VBX-style controls. By reading this book you learn what the differences are between these two. Unfortunately, no mention of OLE custom controls (OCX-style controls, an extention of VBXs) is included.
To emphasize the difference between standard and VBX-style controls (in design as well as in use), the book shows how to create your own custom controls in C/C++. This is no doubt the better way to master them! To implement VBX controls you need the VB SDK, but don't worry, even without this SDK the book is worth reading because it contains a lot of useful information about usage of VBX controls in applications.
The first two chapters describe the historic details of custom controls and Windows, written in the exciting Duntemann style. The following chapters present custom controls as ideal software components, not just "gadgets," and show that VBX controls have use beyond Visual Basic. (For instance, VBX level 1.0 controls can be used with Visual C++ and Borland C++, and with Delphi.)
The third chapter starts the real work, by building a framework or "skeleton" custom control. Actually, this skeleton does nothing, but it serves as the platform with already half the work done to build future example controls in subsequent chapters. This chapter provides much detail, as it is the foundation for the rest of the book.
Chapter four describes design guidelines and shows some different ways to use custom controls in an application. This chapter is really short, being preparatory to chapters five through eleven, where a total of seven custom contols are implemented in both general and VBX style.
The Seven Custom Controls
Here are the seven controls presented in the book:
The source and executables to these controls are included on the accompanying disk. In my opinion, they are worth the price of the book by themselves! According to the author, book purchasers can treat the source code on the disk as a software package with one license. However, there are no royalties imposed on run-time applications (or accompanying DLLs and VBXs) developed with this source code. So, while you may not distribute the source code, you may distribute DLLs, VBXs, or executables without restriction.
- The Panel Control gives your programs a 3D, high-tech look and feel. This control is presented only in the standard custom control format. As a bonus, however, the book also presents the control with a Borland Pascal interface unit.
- The Virtual Listbox Control can display up to 32K items in a listbox, not simply 32K of total data size, as with normal Windows listboxes.
- The Pagelist Control will let you pick one or more page icons from a horizontal list of icons.
- The Browser Control is a read-only viewer that lets you examine, among other things, database records, much like the Visual Basic Data control.
- The Text File Viewer Control can view up to 32K lines, and can be expanded to show even more lines.
- The Text File Editor Control, based on the Text File Viewer, can edit up to 32K lines. Compare that to the normal Windows Edit Control that can hold only up to 32KB of data. This text file editor supports communication with the clipboard and all common text editing features.
- The IniData Control is a special-purpose edit control that manages Windows INI files. It even contains a security feature that enables you to encrypt selected items from an INI file.
The appendix presents a detailed view of the controls' use. These VBX controls will work with Borland C++, Microsoft Visual C++, and Visual Basic. The generic version of these custom controls will work in any Windowsdevelopmentenvironment.
The disk contains full C/C++ source code of everything discussed in the book, plus project files for Turbo C++ and Borland C++, and makefiles for Visual C++. The online documentation includes a windows helpfile for every example custom control. The code is of good quality, and is made clear by intelligent use of comments. I'm a little disapointed that almost none of the sources are specifically C++. I wouldn't mind seeing a C++ class wrapper around the skeleton custom control, for example. Of course, readers can easily extend the generic C source code itself.
Do It Yourself
This book will teach you the inner workings of Windows custom controls. The included C/C++ skeleton custom control enables you to build your own custom controls, while the book's highly detailed examples will help you master the entire process from start to finish. I recommend this book for all serious windows programmers.Title: Windows Programming Power with Custom Controls
Authors: Paul Cilwa & Jeff Duntemann
Publisher: The Coriolis Group (1994)
Pages: 496
Price: $39.93 (with 3.5" disk)
ISBN: 1-883577-00-4