PART 4

ActiveX Documents


CONTENTS

This part of the book posed a truly unique challenge for me. You see, any book, by definition, is influenced by the opinions of the author as to what is important. Since this book is designed to supplement rather than replace the Visual Basic documentation, this perspective becomes significant. Everything I have written so far is something I believe you either must know or will find extremely useful in creating ActiveX components. And creating ActiveX components is, in and of itself, extremely important for every Visual Basic programmer to know how to do.

So now we come to ActiveX documents. What are they good for? They can be used with the Microsoft Office Binder. Cool. But does anyone actually use the Microsoft Office Binder? They can be used to help create new tool windows for the Visual Basic design environment. But this is mostly of interest to add-on vendors. How many typical VB programmers create their own VB add-ins? They can run within Web browsers. But if ActiveX controls run on Web pages, where do ActiveX documents fit in? And is anyone actually using ActiveX documents in this manner?

The importance of ActiveX code components (DLL and EXE servers) is self-evident: every major Windows application from most vendors, including Visual Basic itself, is now based on this technology. The importance of ActiveX controls is also clear: all Visual Basic programmers use controls in their applications. Even if ActiveX controls do not catch on for the Internet or intranets, their importance for application development under Windows will continue to grow.

But at this time it is not completely clear to me that ActiveX documents are actually going to become widely accepted. I'm not even convinced that this technology is truly important in the long run.

Given this book's philosophy, I could not even begin to write the next two chapters without first establishing a reasonable scenario of how and why most Visual Basic programmers might use ActiveX documents. To help me accomplish this, I turned to a friend of mine, Carl Franklin, who is a well-known author and speaker on Visual Basic-related subjects and co-founder of "Carl and Gary's Home Page" (http://www.apexsc.com/vb). Their page is an excellent resource site for Visual Basic programmers.

I've had several discussions with Carl, during which he waxed eloquent about the wonders of this technology. So I asked him to write a few paragraphs about ActiveX documents. My hope was that this would not only provide me with a framework for this part of the book but also provide a good balance for the skepticism I have expressed here. This was his response.

"I always go by the rule 'Use the right tool for the job.' There are four main types of Web pages. Static HTML, Dynamic, Forms, and Applications. Granted, the world hasn't seen many applications on the Web, but I believe this is only because when we think of the Internet we think of words like download and Web site. If there are applications on the Net, we think of first downloading them and then running them.

"This is a natural way to think when you are limited to the speed that modems deliver. In fact, historically you can see a reoccurring trend where people fail to think in the future because our knowledge has been shaped by the past. We bring forward all the bad habits we've learned when our hands were tied. Now that we have a wide open frontier, it is difficult to change the way we think about what is and is not feasible.

"Getting back to my point, Mr. Gates in Redmond is betting the bank that Web sites and applications are on a collision course. So much so that the next version of Windows 95 will (for better or for worse) blur the lines between applications and Web sites so much. The two ideas will become one.

"Think back to the late '80s, when everyone wanted a VB front end to their particular database, DOS app, or what have you. As features became more in demand, it became harder to do things using the same old tools, and the third-party VB tools had begun. Well, HTML forms are the starting point for doing the same thing on the Internet.

"An ActiveX Document is a program. (Think of it as a VB Form, in which the menus and toolbars merge with its host viewer, Internet Explorer.) To me, ActiveX Documents represent an opportunity for application developers to reach the widest audience possible: The world. By now we should have figured out that in the software business, perception is everything. Without good packaging, software does not sell. There is nothing new about downloading and running a program. But, people are more willing to check it out if it's on the Net. Even though an ActiveX Document downloads, registers, and runs locally, it runs in the browser, giving the user the perception that it's on the Internet. And in fact, it is. Where else can you give someone a URL that installs your software and runs it, all without user intervention? That's a distribution dream come true! And updates? Hit refresh. How totally cool!

"There are countless possibilities for ActiveX Documents: games, training, truly interactive Web pages, as well as complete applications. Almost any Windows application can run as an ActiveX Document. They load fast too. Now how much would you pay? If I seem excited it's because I can see the potential here. Write any kind of application for the Net. Cool."

That was what Carl said. So for the next two chapters, I will mostly set my skepticism aside and try to look at ActiveX documents from Carl's point of view.

My first step was to imagine how a business, say, for example, a realtor's office, might deploy this technology. I think you'll find the results intriguing. But first, we have to cover the fundamentals, so come along with me and take the next leg of our journey.