Structure of an OLE storage

An OLE storage is a repository of OLE data. A storage is like the directory structure on a disk. It can be an OLE object and can contain other OLE objects, each contained within the storage, or within a substorage within the storage. The substorages can be separate OLE objects—unrelated pieces like the files in a directory—or they can form a larger OLE object, such as a document that includes pictures as shown in Figure 19-3.

Figure 19-3: OLE storage structure

In the example, OLE Object A is a document that includes pictures. It contains Stream A 1, a dependent component, and two substorages, OLE Objects B and C. OLE Object B has the dependent components Stream B 1 and Stream B 2. Ole Object C includes Stream C 1 and Stream C 2 and another substorage, OLE Object D. OLE Object D contains Stream D 1.

A storage or substorage that contains an OLE object has identifying information that tags it as belonging to a particular server application. Below that level, the individual parts should be manipulated only by that server application. You can open a storage that is a server’s object to extract an object within the storage, but you should not change the storage.

A storage that is an OLE object has presentation information for the object. OLE does not need to start the server in order to display the object, because a rendering is part of the storage.

A storage might not contain an OLE object—it might exist simply to contain other storages. In this case, you cannot open the storage in a control (because there would be no object to insert).