ISupportLastWriteTime Interface

Represents a synchronization provider that is able to report the date and time when an item or change unit was last changed. This ability is useful to an application that implements last-writer-wins conflict resolution.

Syntax

interface ISupportLastWriteTime : IUnknown

Members

ISupportLastWriteTime method

Description

ISupportLastWriteTime::GetItemChangeTime

Gets the date and time when the specified item was last changed.

ISupportLastWriteTime::GetChangeUnitChangeTime

Gets the date and time when the specified change unit was last changed.

Remarks

This interface is typically implemented by a provider. If a provider implements this interface, it must return a pointer to it when IID_ISupportLastWriteTime is passed to the QueryInterface method of its data transfer interface. The data transfer interface is the interface that a provider returns in response to the ISynchronousDataRetriever::LoadChangeData method.

To implement last-writer-wins conflict resolution, an application typically performs the following steps:

  1. Registers an ISyncCallback object to receive conflict notifications.

  2. In the ISyncCallback::OnConflict method, calls IChangeConflict::GetDestinationProviderConflictingData and IChangeConflict::GetSourceProviderConflictingData on the IChangeConflict object to get the data transfer interfaces for the conflicting changes.

  3. Passes IID_ISupportLastWriteTime to the QueryInterface method of each data transfer interface to get the ISupportLastWriteTime objects that represent the conflicting changes.

  4. Calls GetItemChangeTime or GetChangeUnitChangeTime on the ISupportLastWriteTime objects to get the last date and time the changes were made.

  5. Compares the date and time values to determine which change was made last.

  6. Indicates which change to keep by using the IChangeConflict::SetResolveActionForChange or IChangeConflict::SetResolveActionForChangeUnit method.

Requirements

Header: Synchronization.idl

See Also

Concepts

Sync Framework Core Components