Persistence

Persistence is achieved by implementing IPersistStorageIPersistStream, or IPersistFile. These all derive from IPersist.

Windows is file-based, so the most common of these is IPersistFile. Typical API usage is asymmetric. Call IPersistFile::Save to save the object, but to load an object, most often you’d use CoGetInstanceFromFile. This in turn will call IPersistFile::Load. It returns an array of MULTI_QI objects.

Internally, CoGetInstanceFromFile calls GetClassFile to look up the CLSID from the file name.


References