Click or drag to resize

CCacheEntry<T>::IsValid

Indicates whether or not a cache entry is valid.

virtual bool CCacheEntry<T>::IsValid() const;
Return Value

Returns true if the specified value is valid, otherwise false.

Example

The following example demonstrates use of the IsValid function.

C++
// CoAcme4321.cpp
STDMETHODIMP Acme4321::Configure(double Frequency, double Gain)
{
  HRESULT hr = S_OK;

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

  if (pEntry->IsValid())
  {
     // ...
  }

  return hr;
}
See Also

Download a complete CHM version of this documentation here.