![]() | GetOrCreateCacheEntry |
Creates or retrieves a cache entry for a specified property.
template <typename T> CCacheEntry<T>* GetOrCreateCacheEntry(const CString& strKey);
[in] Name of property to retrieve cache entry. For more information, see property identifiers.
Returns a pointer to a CCacheEntry object, which represents the cache entry for the specified property.
The following example demonstrates use of the GetOrCreateCacheEntry function.
// 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; }