Windows Dev Center

IOleCacheControl::OnRun method

Notifies the cache that the data source object has entered the running state so that the cache object can establish advise sinks as needed.

Syntax


HRESULT OnRun(
  [in] LPDATAOBJECT pDataObject
);

Parameters

pDataObject [in]

A pointer to the IDataObject interface on the object that is entering the running state.

Return value

This method returns S_OK on success. Other possible return values include the following.

Return codeDescription
E_INVALIDARG

One of the arguments is not valid.

E_UNEXPECTED

An unexpected error has occurred.

E_OUTOFMEMORY

Insufficient memory is available for this operation.

 

Remarks

When OnRun is called, the cache sets up advisory connections as necessary with the source data object so it can receive notifications. The advisory connection 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 passively, and not call OnRun. These applications must call IOleCache2::UpdateCache, IOleCache::InitCache, or IOleCache::SetData to fill the cache when necessary to ensure that the cache gets updated.

OnRun does not add a reference count on the pointer to IDataObject passed in pDataObject. Because it is the responsibility of the caller of OleRun to ensure that the lifetime of the pDataObject pointer lasts until OnStop is called, the caller must be holding a pointer to IDataObject on the data object of interest.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

OleIdl.h

IDL

OleIdl.Idl

IID

IID_IOleCacheControl is defined as 00000129-0000-0000-C000-000000000046

See also

IOleCacheControl
IOleCacheControl::OnStop
IOleCache2::UpdateCache

 

 

Community Additions

ADD
Show:
© 2015 Microsoft