Desaware Home
Products    Purchase    Publishing    Articles   Support    Company    Contact    
Licensing System
Professional Services
Universal .NET
Universal COM
.NET Books
COM Books
Visual Basic Programmer's Guide to the Win32 API
Edition History
Exploring VB6 (series)
Developing COM/ActiveX Components with VB6: A Guide to the Perplexed
What's New from the VB 5.0 edition
Win32 API Puzzle Book and Tutorial
Chapter Outline
Sample Puzzle
NT Security Programming with Visual Basic 6
Visual Basic Programmer's Guide to the Windows 16 bit API
Other Books

Contact Desaware and order today

Sign up for Desaware's Newsletter for the latest news and tech tips.

Note: This page describes a legacy product or book. The page is available for archival purposes and as a courtesy to those who have linked to it, but is no longer being updated or maintained.
Buy on Amazon

Developing COM/ActiveX Components with VB6: A Guide to the Perplexed
$19.95 [eBook]


Book Cover
Learn to create any type of component in VB6

Contact Desaware directly to purchase the eBook edition.

I've been waiting to write a book on COM/ActiveX technology for years.

True, it didn't used to be called ActiveX. Perhaps it was called OLE, or OLE Controls, or VBX, or Visual Basic Custom Controls. It doesn't matter. All along I've been working with the technology as it evolved and waiting for the right time to do a book on the subject. I was waiting for Visual Basic to mature to the point where it could be used to create these types of controls.

When I saw the beta for Visual Basic 5, I knew that my wait was over. Which left me with a problem. How do I write a book on this technology that will be both incredibly useful to Visual Basic programmers and also stand out from the myriad of ActiveX VB books that undoubtedly will appear on the bookshelves at the same time? How do I write a book detailed enough for the advanced programmer, but with enough scope to welcome even a beginning Visual Basic programmer to ActiveX development?

So I put on my "programmer" hat and thought about the things that I like and hate about technology books, and quickly realized this:

I hate manual rehashes.

Simply paraphrasing the Microsoft documentation is pointless. A certain amount of that is inevitable, I suppose, but at least an author should add a significant amount of new material-and perhaps a creative new way of looking at the technology that does not echo the manuals. I also hate having to read through things I know to find a few tidbits of new information. You know the kind of book I'm talking about, where a supposedly advanced book starts out by explaining how to draw controls on forms, click a mouse, and turn on the computer.

I knew I wanted to do a comprehensive book on ActiveX and object programming using Visual Basic. I knew I did not want to waste a lot of time rehashing the manual. In fact, I'll let you in on a little secret: The Visual Basic Documentation is not bad at all. I suppose that is an odd thing for an aftermarket book author to say.

I realized as I was reading the VB documentation that it would be perfect.

  • if only it took the time to explain a few core concepts instead of assuming the understanding of them.
  • if only it had a few more examples illustrating how to go about certain tasks.
  • if only I could have someone watching as I read to explain some of the sections that aren't as clear as they could be and answer questions that arise as I read it.
  • if only it would go a little bit beyond explaining how to perform certain tasks and expand into why some tasks are necessary, which are truly important, and how to choose between different ways to perform the same task.
  • if only it included some information for more advanced programmers. For example: how this technology works behind the scenes or how to subclass a control off a built-in Windows control.

As I realized these things this, I knew what I wanted to do. I did not want to write The ActiveX Bible for Visual Basic. Microsoft already wrote it; it's in the documentation. I wanted to write the commentary!

A Talmudic Sage named Maimomides wrote the original Guide to the Perplexed in the Middle Ages. It was a guide that did not try to replace the scripture, but rather elaborate on it, interpret it, and help ordinary people understand it. While I'm certainly not a sage of his caliber, I know he had the right idea.

What's in a guide to the perplexed?

"So what's in this book?" you may ask. Here are some of the goals I reached for and philosophies I followed while writing it.

On Concepts

There are certain core concepts a programmer must understand to write ActiveX components (not to mention to program in Visual Basic in the first place). I wanted to take a step back and cover those concepts in depth. I wanted to cover them in such a way that even a beginning VB programmer could understand them. This was my task in Part 1.

On My Target Audience

I focused on information that relates to the COM-based features in recent versions of Visual Basic. If you are completely new to Visual Basic, this is probably not the book to start with, because I assume you already know how to use Visual Basic and are familiar with the general syntax of the language.

However, this book is definitely intended for people who have not yet made extensive use of the new object-oriented constructs introduced with Visual Basic 4.0 (such as classes). It is also for those who have not yet worked with OLE or COM/ActiveX technology.

On Approach

I assume that you have access to the Visual Basic documentation. This book is intended to supplement the Microsoft documentation, not replace it. While there is some overlap by necessity, the emphasis is always to go beyond the documentation in the following ways:

  • Interpretation, clarifying those subjects that are unclear. Translating them into something that resembles English when necessary.

  • Illustration, adding new examples where appropriate. Showing alternate ways to implement certain features. Showing how things crash if you do them incorrectly.

  • Elaboration, demonstrating techniques that are not covered in the documentation. Explaining how some of the technology works behind the scenes.

  • Commentary, discussing not just how you can program, but how you should program. Explaining why some things are done the way that they are, and otherwise adding my two cents into the fray.

On Style

The entire book is written just like this introduction-in the first person. A commentary is, by definition, more than just an authoritative presentation of accurate technical information. It also includes interpretation and opinion. So, while I'll certainly make every effort to make sure that this book is technically accurate and reasonably comprehensive, there will be portions of the book that are based on personal opinion and biases. In other words, not only will I tell you about a feature, how it works and why. I might also tell you what I think of it, and whether you should use it or perhaps try a different approach.

If you find any technical inaccuracies, I will welcome e-mail on the subject ( and make corrections promptly for the next edition, as well as post the correction on our Web site at . If you disagree with my interpretation or commentary, I will also welcome e-mail on the subject, will read it carefully and will either post the opposing viewpoint, or delete the message -- depending on the nature of your message and my personal whim.

On Scope

You've probably noticed that Visual Basic is enormous. It has evolved dramatically from version 1.0 in both size and scope. In order to make it possible to come out with a good ActiveX book in a timely manner, I had to decide how much information to cover. I have no doubt that I will receive many e-mail messages complaining that I left out that "one crucial subject" that is needed to make the book perfect. So let me start by telling you what I included and what I left out and why.

What's In and Why

  • Core concepts relating to ActiveX Because I believe an expert is someone who understands the fundamentals of a subject very well. With the advent of classes and ActiveX technology in Visual Basic, a good understanding of the underlying concepts of ActiveX are essential to every Visual Basic programmer.
  • Classes Working with classes is now a key part of the foundation for Visual Basic programming. Many VB programmers don't believe this yet. I intend to change their minds.
  • Code Components (Alias, OLE servers, EXE servers) With the appearance of event sinking and multithreaded objects with Visual Basic, this type of component has become even more exciting than before. Plus, it is the foundation for understanding ActiveX controls and documents.
  • ActiveX Controls I truly believe this is one of the two most important features in Visual Basic (the other being native code compilation). I believe that now that it is possible for VB programmers to create ActiveX controls, they all will.
  • IIS Applications This new feature to Visual Basic 6 is, I think, the most important new feature in the language for those who are interested in server programming on the Internet. This edition includes two new chapters that relate to this technology.

What's Not In and Why

  • The VB IDE Using the VB environment itself is not particularly hard and is well documented in the Microsoft manuals. I'll cover this subject only enough to show you how to set attributes for ActiveX features.
  • Wizards The whole idea of wizards is to simplify certain tasks, so discussing how to use a wizard seems rather pointless. But I will take a look at the code that wizards produce (a very interesting subject), and discuss when you should and should not use them.
  • Remote Automation and DCOM It's not quite accurate to say that these are not covered. In fact, you'll find what I hope is a strong introduction to the concepts involved. What's missing are the myriad of details needed to actually configure real world systems to use these new technologies. Issues such as security and running Microsoft's various configuration programs is beyond the scope of this book.
  • Microsoft Transaction Server Again, I've actually included some information on MTS, especially where it relates to subjects that lie at the heart of this book such as object lifetime. But MTS deserves a book fo its own. This book will at least get you started in the right direction.
  • Language, controls, and almost everything else This book is about ActiveX technology. There are dozens of other VB books on many different subjects available, For example, to study how to use the Win32 API from Visual Basic you can use my book Visual Basic Programmer's Guide to the Win32 API , SAMS, 1999.
  • All of the content of the book is based on the Enterprise edition of Visual Basic. However, there are very few subjects that do not apply directly to the professional edition as well. Refer to the online Visual Basic help for limitations relating to the standard edition.


Want more examples?
Products    Purchase    Articles    Support    Company    Contact
Copyright© 2012 Desaware, Inc. All Rights Reserved.    Privacy Policy