Skip to content

CCacheEntry<T>::UpdateValue

Stores a value in a cache entry and marks the entry as valid.

void CCacheEntry<T>::UpdateValue(T value);

value

[in] New value to store in the cache entry.

The following example demonstrates use of the UpdateValue function.

CoAcme4321.cpp
STDMETHODIMP Acme4321::put_Bandwidth(double val)
{
HRESULT hr = S_OK;
// Send the new value to the instrument
hr = InstrPrintCommand(val);
// If the instrument was updated successfully, update the cache entry
// for the Bandwidth property so it reflects the new value
if (SUCCEEDED(hr))
{
CCacheEntry<double>* pEntry = GetOrCreateCacheEntry<double>(_T("IAcme4321.Bandwidth"));
pEntry->UpdateValue(val);
}
return hr;
}