VB6 Programmer's Introduction to COM
In order better to understand what COM is useful for, and why it works the way it does, it's revealing to delve into the genesis of COM and trace how it has evolved into its present form. There are two technologies that we can identify as the springboard for COM: OLE and DDE. OLE (later called OLE 1.0) is short for Object Linking and Embedding, which in its original form was a technology that tried to solve the problem of compound documents.
A compound document contains data of several different formats. To help you picture what I mean, think about a word processing document such as a status report. It's probable that you would want to include some calculations from a spreadsheet in a document like this, and maybe a pie chart as well. Before OLE, even if you were somehow able to put the information into the document, there was no standard technique for automatically updating the document when figures in the spreadsheet changed, or for changing the pie chart to a bar chart, for example.
OLE 1.0 provided a solution for this problem by enabling you to take your spreadsheet and place it directly into a word processor document, as in the figure below. Changes to the spreadsheet are automatically and immediately reflected in the document, edits to the embedded spreadsheet can be made through the document simply by double clicking on it, and all the data in the document can be stored together in a single file.
This was a great piece of technology, but it was rather ahead of its time in terms of the hardware that was available to support it. Working with OLE 1.0 required quite a bit of memory and CPU time, but it did get the minds at Microsoft thinking about the best way of getting software components to interact with one another, and in as efficient a manner as possible.
Before even OLE 1.0, a little gremlin called Dynamic Data Exchange (DDE) was being used to allow pieces of software to interact with each other. It allowed data to be transferred between two applications, and also made it possible for one application to be notified when data in another changed. However, DDE didn't catch on - not only did it suffer from poor performance, but also it was difficult to use, and quite easy for the link between the two applications to break. Even today though, you can still find information about DDE in the Visual Basic help files.
Page 5 of 12