Technology Dock - Information Technology Articles

Object Linking and Embedding - November 1992
(Archive Article)
by Dean S. Tripodes

[Man at PC]

One of the greatest advantages of networks is the ability to share information and peripherals such as printers and hard disks. Sharing information is also quite important at the stand alone work station, as well. With Windows, you can share data between Windows applications in several ways. You can use the Cut and Copy commands to place data on the Clipboard, and then use the Paste command to place the data in another kind of document or file.

A second way takes advantage of Dynamic Data Exchange (DDE) in Windows applications to retrieve and update information dynamically. For example, you can use the Paste Link command to link data from one Microsoft Excel spreadsheet to another spreadsheet or to a Microsoft Word for Windows document. The data is updated dynamically in the second spreadsheet or Word document whenever it is edited in the original spreadsheet.

The third way is to use the Object Linking and Embedding (OLE) protocol for those Windows applications that support it. You can place data from one application in another kind of document as an object or as an iconic package. Whenever you want to update or view the embedded data, you can double click it to run the application in which the data was originally created. For example, you can use the Paste Special command in one Microsoft Excel spreadsheet to copy a graph created in another spreadsheet. There is an important difference, however, between only linking an object and pasting an embedded object. With linking, the object is tied to the master or source document. You cannot change a number in a cell range or augment a pie chart or bar graph. With an embedded object, simply double click on it, and the source application comes up, along with full editing capabilities.

Any Windows application that uses OLE can work with other OLE applications to produce documents that contain different kinds of data. You can view or modify data in a compound document without knowing what applications were used to create the original data. Whenever you double click a part of the compound document to work with it, the application in which it was created will start automatically. A good example of this is cc:Mail for Windows. Attach a bitmap graphic to an email message, and send it to yourself. When you click on the latest message in your inbox, you will see two icons. One represents the message, and the second the bitmap. If you click on the second icon, Windows Paintbrush will automatically be loaded to view and allow editing of the bitmap graphic. Different applications can have different names for OLE objects. We call the bitmap an embedded object, though cc:Mail refers to it as an "Attached" object.

A compound document can contain formatted text, graphics, and data from a spreadsheet or a database. It can also contain icons that run sound recordings or play multimedia devices. The more hardware you have to support creating and playing multimedia through sound boards, CD-ROM, and other media players, the more rich a compound document you can create. But even with a basic 80386 workstation, you can take advantage of OLE to create compound documents.

An object in a compound document is any encapsulated data that can be displayed and manipulated by a user. For example, a single cell, a range of cells, a graphed data range, or an entire spreadsheet could be embedded as an object in word processing document. Any data can be an object if it was created in a Windows application that uses OLE. This is different, however, from a package which is an embedded icon that contains an object, a file, or part of a file, or a command.

The client application is any Windows application that can accept, display, and store objects. Usually a client application displays a distinctive border or some other visual cue so that you can identify an object embedded in a file. The client application stores some information for embedded objects, such as the target printer and page position, how the object is activated, and which server application is associated with the object. For example, in an Excel client spreadsheet, an embedded graph would have displayed on the status bar: =EMBED("ExcelChart", "Chart")

The server application is any Windows application in which you can edit an object when Windows informs you that you have selected the object in a client application. Some server applications also use an object handler, which is a Dynamic Link Library that acts an intermediary between the client and server applications. The object handler for an application is usually used to improve performance, such as an improved screen refresh when an object is changed in the window of the client application. Some applications are capable of acting as both OLE client and server, Excel being a good example of one.

Microsoft has begun limited beta testing of the latest version of its Object Linking and Embedding. OLE 2.0 offers significant enhancements that make it more robust and more attractive to applications designers. OLE has been widely adopted in the software community. The first version is implemented in applications from a variety of vendors, including Word and Quattro Pro as well as the above mentioned Excel and cc:Mail. Unfortunately, we won't see OLE 1.0 in WordPerfect for Windows until the incremental upgrade 5.2 due next year.

In its current form, OLE is a set of Dynamic Link Libraries (DLL's) included in Windows 3.1 that allows a programmer to establish a connection between a defined "object" in one application and a document in another. The basic function of OLE is to bring data into one document from another format and not lose that format. This is more complex than at first it may seem.

For example, a word processing document can import a chart from a separate application without reprogramming the document to handle the formats necessary to display the chart. "Embedding" places a stand alone chart object into the document, while "Linking" connects the chart object back to the original.

The new release of OLE includes three significant upgrades. One is in-place editing, which allows the user to edit the object included in a document without exiting that document. The second transfers objects by a drag and drop function, from application to application and from window to window. The third is an enterprise macro language, which will provide OLE programmers with a system level programming language to use with a variety of applications.

OLE uses the Windows' Clipboard and NetDDE, Network Dynamic Data Exchange, facilities to cut and paste objects. However, OLE's enterprise macro language will eventually replace DDE. Microsoft has even hinted that OLE will form the infrastructure of Cairo, their next generation object oriented operating system. The future for OLE looks even better with Windows NT, as it will include a 32 bit version of OLE that will be even more robust in features and speed.


Terms of Use For Baywalk - Use of Baywalk signifies your agreement to the terms of use.



Top of Page