IOleCacheControl::OnRun
Notifies the cache that the data source object has now entered its running
state.
HRESULT OnRun(
    DATAOBJECT * pDataObject
  | //Points to the object that is now running
  | 
   );
  | 
  | 
Parameter
pDataObject
[in]Points to the object that is entering the running state.
Return Values
S_OK
The cache was notified and 
pDataObject is valid.
E_OUTOFMEMORY
The cache was not notified because the system ran out of memory.
E_INVALIDARG
One or more invalid arguments.
E_UNEXPECTED
An unexpected error occurred.
Comments
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
				
 - 
				MegaDetailed.Net
				Unix Manual Pages
				Delphi Examples