# IPersistMemory::Load

Instructs the object to load its persistent data from the memory pointed to by pvMem where cbSize indicates the amount of memory at pvMem. The object must not read past the address (BYTE*)((BYTE *)pvMem+cbSize).

HRESULT Load(

void* pvMem, | //Pointer to the stream from which the object should be loaded
ULONG cbSize | //Amount of memory from which the object can read its data
); |

Parameters

pvMem
  [in] Pointer to the address in memory from which the object can read up to cbSize bytes of its data.
cbSize
  [in] The amount of memory available at pvMem from which the object can read its data.

Return Values

S_OK
  The object successfully loaded its data.
E_UNEXPECTED
  This method was called after the object was already initialized with IPersistMemory::Load. Only one initialization is allowed per instance.
E_POINTER
  The pointer in pvMem is NULL.

Remarks

Any object that implements IPersistMemory has some information to load persistently, therefore E_NOTIMPL is not a valid return code.

See Also

IPersistMemory::InitNew