共用方式為


IOleLink::SetUpdateOptions

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method specifies how often a linked object should update its cached data.

Syntax

HRESULT SetUpdateOptions(
  DWORD dwUpdateOpt
);

Parameters

  • dwUpdateOpt
    [in] Value that specifies how often a linked object should update its cached data. The legal values for dwUpdateOpt are taken from the enumeration OLEUPDATE.

Return Value

This method supports the standard return value E_INVALIDARG.

If the method succeeds, the return value is S_OK.

Remarks

The default update option is OLEUDPATE_ALWAYS. The linked object's implementation of the IPersistStorage::Save method 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 implementation is called.

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

Notes to Callers

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

The user selects the update option for a linked object using the Links dialog box.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header Oleidl.h, oleidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

IAdviseSink::OnSave
IOleLink::Update
IOleObject::Close
IOleObject::Update
IPersistStorage::Save
OLEUPDATE