# IOleCache2

The IOleCache2 interface allows object clients to selectively update each cache that was created with IOleCache::Cache.

##### When to Implement

The IOleCache2 interface can be implemented by an object handler and an in-process server. Rather than implementing, however, it is typical to use or aggregate the OLE implementation in the default handler, a pointer to which is available through a call to CreateDataCache.

##### When to Use

The OLE-provided implementation includes implementations of the IOleCache interface methods, from which IOleCache2 inherits its contract definition. The IOleCache2 interface is called by container applications, object handlers, or in process servers to update one or more of the caches that were created with the IOleCache::Cache method. This extended interface was added so client applications can exercise precise control over updates to the caches being maintained.

Methods in VTable Order

IUnknown Methods | Description
QueryInterface | Returns pointers to supported interfaces.
AddRef | Increments the reference count.
Release | Decrements the reference count.

IOleCache Methods | Description
Cache | Adds a presentation to the data or view cache.
Uncache | Removes a presentation previously added with IOleCache::Cache.
EnumCache | Returns an object to enumerate the current cache connections.
InitCache | Fills the cache with all the presentation data from the data object.
SetData | Fills the cache with specified format of presentation data.

IOleCache2 Methods | Description
UpdateCache | Updates the specified cache(s).
DiscardCache | Discards cache(s) found in memory.