IOleLink::SetUpdateOptions method

Specifies how often a linked object should update its cached data.

Syntax


HRESULT SetUpdateOptions(
  [in] DWORD dwUpdateOpt
);

Parameters

dwUpdateOpt [in]

Specifies how often a linked object should update its cached data. The possible values for dwUpdateOpt are taken from the enumeration OLEUPDATE.

Return value

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

Return codeDescription
E_INVALIDARG

The supplied value is invalid.

 

Remarks

Notes to Callers

Your container application should call IOleLink::SetUpdateOptions when the end user changes the update option for a linked object.

The end user selects the update option for a linked object using the Links dialog box. If you use the OleUIEditLinks function to display this dialog box, you must implement the IOleUILinkContainer interface. The dialog box calls your IOleUILinkContainer::SetLinkUpdateOptions method to specify the update option chosen by the end user. Your implementation of this method should call the IOleLink::SetUpdateOptions method to pass the selected option to the linked object.

Notes to Implementers

The default update option is OLEUDPATE_ALWAYS. The linked object's implementation of IPersistStorage::Save saves the current update option.

If OLEUDPATE_ALWAYS is specified as the update option, the linked object updates the link's caches in the following situations:

  • When the update option is changed from manual to automatic, if the link source is running.
  • Whenever the linked object binds to the link source.
  • Whenever the link source is running and the linked object's IOleObject::Close, IPersistStorage::Save, or IAdviseSink::OnSave implementations are called.

For both manual and automatic links, the linked object updates the cache whenever the container application calls IOleObject::Update or IOleLink::Update.

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_IOleLink is defined as 0000011d-0000-0000-C000-000000000046

See also

IOleLink
IOleObject::Update
IOleLink::GetUpdateOptions
IOleLink::Update
IOleUILinkContainer
OleUIEditLinks

 

 

Show: