Click or drag to resize

GetOrCreateCacheEntry

Creates or retrieves a cache entry for a specified property.

template <typename T>
CCacheEntry<T>* GetOrCreateCacheEntry(const CString& strKey);
Parameters
strKey

[in] Name of property to retrieve cache entry. For more information, see property identifiers.

Return Value

Returns a pointer to a CCacheEntry object, which represents the cache entry for the specified property.

Example

The following example demonstrates use of the GetOrCreateCacheEntry function.

C++
// CoAcme4321.cpp
STDMETHODIMP Acme4321::put_Bandwidth(double val)
{
  HRESULT hr = S_OK;

  // Retrieve the cache entry for the Bandwidth property
  CCacheEntry<double>* pEntry = GetOrCreateCacheEntry<double>(_T("IAcme4321.Bandwidth"));

  // ...

  return hr;
}
See Also

Other Resources

Download a complete CHM version of this documentation here.