IPersistMemory  1RMW3VU

The IPersistMemory interface operates exactly as IPersistStreamInit, except that it allows the caller to provide a fixed-size memory block (identified with a void *) as opposed to IPersistStreamInit which involves an arbitrarily expandable IStream.

The cbSize argument to the Load and Save methods indicate the amount of memory accessible through pvMem.

The IsDirty, GetSizeMax, and InitNew methods are semantically and syntactically identical to those in IPersistStreamInit. Only Load and Save differ.

When to Implement

An object implements this interface to save itself in memory.

When to Use

A container calls the methods of this interface to instruct an object to save and load itself in memory.

Methods in Vtable Order

IUnknown1NEM0LU Methods

Description

QueryInterface2Y54585

Returns pointers to supported interfaces.

AddRef1SHW0SS

Increments reference count.

ReleaseDUW01A

Decrements reference count.

 

IPersistHYD1T0 Method

Description

GetClassID15MI_PE

Returns the class identifier (CLSID) for the component object.

 

IPersistMemory Methods

Description

IsDirty17ESMGV

Checks the object for changes since it was last saved.

LoadRQSX9K

Initializes an object from the memory block where it was previously saved.

Save5HNK7.

Saves an object into the specified memory block and indicates whether the object should reset its dirty flag.

GetSizeMaxNVSHV

Returns the size in bytes of the memory block needed to save the object.

InitNew12K3I8T

Initializes an object to a default state.