Naming and Storing Property Sets

The purpose of having a property set is to facilitate data exchange between components and applications. I shouldn't need to say too much to convince you that a property set isn't necessarily the most efficient way to store your own internal data. You need to use a property set primarily when you want to share persistent information.

A property set is always considered an attachment to a compound file. It is contained either as a single stream in that file or as a substorage in that file if the property set spans multiple streams in that substorage. The reason is simple: any other code can navigate through your compound file and locate property sets. In Chapter 7, we saw that OLE reserves any storage or stream element name from ASCII 5 through ASCII 31 for its own use. Naming a property set is one use for a reserved prefix. Specifically, the ASCII 5 prefix (usually written as \005) identifies a common property set in a storage or stream. Common means that the property set is known to many applications and to the system. The Summary Information stream is an example of this.

When property sets are stored in a substorage, the primary stream of the set should be named "CONTENTS" and the CLSID of the storage should be identical to the CLSID written into the property set. Only when the property set takes up an entire substorage are properties of type VT_STREAM, VT_STORAGE, VT_STREAMED_OBJECT, VT_STORED_OBJECT, and VT_BLOB_OBJECT legal. Specific substorages or streams containing those other properties are siblings of the "CONTENTS" stream itself.