Notifies the cache that the data source object has now entered its running state.


DATAOBJECT * pDataObject
//Points to the object that is now running



[in]Points to the object that is entering the running state.

Return Values


The cache was notified and pDataObject is valid.


The cache was not notified because the system ran out of memory.


One or more invalid arguments.


An unexpected error occurred.


When IOleCacheControl::OnRun is called, the cache sets up advisory connections as necessary with the source data object so it can receive notifications. The advise sink created between the running object and the cache is destroyed when IOleCacheControl::OnStop is called.

Some object handlers or in process servers might use the cache in a passive manner and not call IOleCacheControl::OnRun. These applications will need to call IOleCache2::UpdateCache, IOleCache::InitCache, or IOleCache::SetData to fill the cache when necessary to ensure the cache gets updated.

IOleCacheControl::OnRun does not create a reference count on pDataObject. It is the responsibility of the caller of OleRun to ensure that the lifetime of pDataObject lasts until OnStop is called. As a result, the caller must be holding a pointer to pDataObject.

See Also

IOleCache2::UpdateCache, IOleCacheControl::OnStop

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database