Persistence Model

[This is preliminary documentation and subject to change.]

One of the great strengths of MMC is its ability to be persistently stored with all data necessary to re-create the tool on any machine. For this reason, a snap-in can implement the OLE interface, IPersistStorage. This interface allows you to make use of OLE's compound file implementation of structured storage. If IPersistStorage is not implemented, IPersistStream is called as an alternative. The latter is a simpler interface for snap-ins whose properties fit in a single stream. IPersistStreamInit can also be used.

The console implements the IStorage interface that generates a storage file. The name of the file is never known to the snap-in but, at some point, the console calls QueryInterface to get a pointer to the snap-in's IPersistStorage. The snap-in's data is loaded and saved, although the console never reads the content of the resulting file. The file is assigned a .MSC extension and the console, in effect, provides storage and allows the snap-in to persist. All of the interfaces noted here are provided as part of COM and are documented in the Platform SDK.