IChangeApplicationServices::GetChangeApplicationContext

Gets an object that represents the current change to be applied.

Syntax

HRESULT GetChangeApplicationContext(
  ISyncChange * pSourceChange,
  ISyncChange * pDestinationVersion,
  IChangeApplicationContext ** ppContext);

Parameters

  • pSourceChange
    [in, unique] A change received from the source provider. Can be NULL when the change batch is part of a recovery synchronization.

  • pDestinationVersion
    [in, unique] The version of pSourceChange in the destination replica. Can be NULL when the destination replica does not have a version for pSourceChange.

  • ppContext
    [out] Returns an object that can be used to process the change.

Return Value

  • S_OK.

  • E_OUTOFMEMORY.

  • E_POINTER.

  • SYNC_E_ACTIVE_CHANGE_APPLICATION_CONTEXT when an IChangeApplicationContext object is already active. The active IChangeApplicationContext object must be processed until its IChangeApplicationContext::GetChangeApplicationAction method returns CAA_FINISHED before another change can be processed.

  • SYNC_E_CHANGE_NEEDS_KNOWLEDGE when pSourceChange does not contain made-with knowledge.

  • SYNC_E_CHANGE_NOT_IN_KNOWLEDGE when the update version or creation version of pSourceChange is not contained in its made-with knowledge.

  • SYNC_E_CHANGE_UNIT_COUNT_MISMATCH when pSourceChange and pDestinationVersion contain differing numbers of change units.

  • SYNC_E_ID_FORMAT_MISMATCH when the format of a specified ID does not match the ID format schema specified when this object was initialized.

  • SYNC_E_INVALID_OPERATION when change application has not been started for a change batch, or when pSourceChange has already been reported as successfully applied.

  • SYNC_E_ITEM_HAS_CHANGE_UNITS when pSourceChange or pDestinationVersion contains change units and the other does not.

  • SYNC_E_NOT_EXPECTED_CHANGE when pSourceChange and pDestinationVersion refer to different item IDs.

Remarks

This method is typically called by the destination provider one time for each change that is sent from the source provider. The IChangeApplicationContext object that is returned can be used to perform conflict detection, conflict resolution, and to determine how the destination provider should apply the change specified by pSourceChange.

See Also

Reference

IChangeApplicationServices Interface