IOleUndoManager::Add method (ocidl.h)

Adds a simple undo unit to the collection. While a parent undo unit is open, the undo manager adds undo units to it by calling IOleParentUndoUnit::Add.

Syntax

HRESULT Add(
  [in] IOleUndoUnit *pUU
);

Parameters

[in] pUU

An IOleUndoUnit pointer to the undo unit to be added.

Return value

This method returns S_OK if the specified unit was successfully added, the parent unit was blocked, or the undo manager is disabled.

Remarks

This method is implemented the same as IOleParentUndoUnit::Add. The parent undo unit or undo manager must accept any undo unit given to it, unless it is blocked. If it is blocked, it should do nothing but return S_OK.

Notes to Implementers

If the undo manager is in the base state, it should put the new unit on the undo stack and discard the entire redo stack. If the undo manager is in the undo state, it should put new units on the redo stack. If the undo manager is in the redo state, it should put units on the undo stack without affecting the redo stack.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ocidl.h

See also

IOleParentUndoUnit::Add

IOleUndoManager