CreateDataCache

Supplies a pointer to a new instance of an OLE-provided implementation of a data cache.

WINOLEAPI CreateDataCache(

LPUNKNOWN pUnkOuter,

//Pointer to whether cache is to be aggregated

REFCLSID rclsid,

//CLSID used to generate icon labels

REFIID riid,

//Reference to the identifier of the interface

LPVOID FAR *ppvObj

//Indirect pointer to interface on supplied cache object

);

Parameters

pUnkOuter
[in] If the cache is to be created as part of an aggregate, pointer to the controlling IUnknown of the aggregate. If not, the parameter should be NULL.
rclsid
[in] CLSID used to generate icon labels. This value is typically CLSID_NULL.
riid
[in] Reference to the identifier of the interface the caller wants to use to communicate with the cache. This value is typically IID_IOleCache (defined in the OLE headers to equal the interface identifier for IOleCache).
ppvObj
[out] Iindirect points to the interface requested in riid on the cache object.

Return Values

This function supports the standard return values E_INVALIDARG and

E_OUTOFMEMORY, as well as the following:

S_OK
The OLE-provided cache was instantiated and the pointer supplied.
E_NOINTERFACE
The interface represented by riid is not supported by the object. The parameter ppvObj is set to NULL.

Remarks

The cache object created by CreateDataCache supports the IOleCache, IOleCache2, and IOleCacheControl interfaces for controlling the cache. It also supports the IPersistStorage, IDataObject (without advise sinks), IViewObject, and IViewObject2 interfaces.

See Also

IOleCache, IOleCache2, IOleCacheControl