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
                    //Address of output variable that receives the 
                    // interface pointer to the 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] Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppvObj contains the requested interface pointer to the supplied 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.

QuickInfo

  Windows NT: Use version 3.1 or later.
  Windows: Use Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in objbase.h.
  Import Library: Included as a resource in ole32.dll.

See Also

IOleCache, IOleCache2, IOleCacheControl