# IPersistStream - URL Moniker Implementation

The URL moniker implementation of IPersistStream is found on an URL moniker object, which supports IUnknown, IAsyncMoniker, and IMoniker. The IMoniker interface inherits its definition from IPersistStream and thus, the URL moniker also provides an implementation of IPersistStream as part of its implementation of IMoniker.

The IAsyncMoniker interface on an URL moniker is simply IUnknown (there are no additional methods); it is used to allow clients to determine if a moniker supports asynchronous binding. To get a pointer to the IMoniker interface on this object, call the CreateURLMoniker function. Then, to get a pointer to IPersistStream, call the QueryInterface method.

IPersistStream, in addition to inheriting its definition from IUnknown, also inherits the single method of IPersist, GetClassID.

Note The current URL Moniker implementation of IMoniker does not support asynchronous storage. Future implementations will do so.

##### When to Use

Call IPersistStream to have the moniker manage its persistent storage.

Remarks

IPersistStream::GetClassID
  Returns CLSID_StdURLMoniker.
IPersistStream::IsDirty
  Returns S_OK if the Moniker has changed since it was last saved (IPersistStream::Save with fClearDirty==TRUE), S_FALSE otherwise.
IPersistStream::Load
  Initializes an URL moniker from data within a stream, usually stored there previously using its IPersistStream::Save (via OleSaveToStream or OleSaveToStreamEx). The binary format of the URL Moniker is its URL string in Unicode™ (may be a full or partial URL string, see CreateURLMoniker for details). This is represented as a ULONG (32-bit) count of characters followed by that many Unicode characters.
IPersistStream::Save
  Saves an URL moniker to a stream. The binary format of URL Moniker is its URL string in Unicode (may be a full or partial URL string, see CreateURLMoniker for details). This is represented as a ULONG (32-bit) count of characters followed by that many Unicode™ characters.
IPersistStream::GetSizeMax
  Returns the maximum number of bytes in the stream that will be required by a subsequent call to IPersistStream::Save. This value is SIZEOF(ULONG)==4 plus SIZEOF(WCHAR)*n where n is the length of the full or partial URL string including the NULL terminator.

See Also

IMoniker - URL Moniker Implementation