The IPersistStream and IPersistStreamInit interfaces save and load objects from a simple serial stream. Both interfaces include the following methods:
Method | Description |
GetSizeMax | Returns the size of the stream needed for the object. |
IsDirty | Checks for changes to the object since it was last saved. |
Load | Initializes the object from where it was saved. |
Save | Saves the object to a stream. |
In addition, IPersistStreamInit has a fifth method called InitNew, which notifies the object when it is being newly created, rather than being loaded from a saved instance. Implementing IPersistStreamInit is recommended because it is the fastest interface and because Visual Basic queries for it before seeking other persistence interfaces. See the COM Programmer's Reference in the Platform Software Development Kit (SDK) section of the Microsoft Developer's Network (MSDN) for more information on IPersistStreamInit.