Skip to content

Latest commit

 

History

History
124 lines (96 loc) · 4.7 KB

nf-ocidl-ioleundomanager-close.md

File metadata and controls

124 lines (96 loc) · 4.7 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:ocidl.IOleUndoManager.Close
IOleUndoManager::Close (ocidl.h)
Closes the specified parent undo unit. (IOleUndoManager.Close)
Close
Close method [COM]
Close method [COM]
IOleUndoManager interface
IOleUndoManager interface [COM]
Close method
IOleUndoManager.Close
IOleUndoManager::Close
_ole_ioleundomanager_close
com.ioleundomanager_close
ocidl/IOleUndoManager::Close
com\ioleundomanager_close.htm
com
4546f270-5cef-42a3-b07a-f0a491e78849
12/05/2018
Close, Close method [COM], Close method [COM],IOleUndoManager interface, IOleUndoManager interface [COM],Close method, IOleUndoManager.Close, IOleUndoManager::Close, _ole_ioleundomanager_close, com.ioleundomanager_close, ocidl/IOleUndoManager::Close
ocidl.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
OCIdl.idl
Windows
19H1
IOleUndoManager::Close
ocidl/IOleUndoManager::Close
c++
APIRef
kbSyntax
COM
OCIdl.h
IOleUndoManager.Close

IOleUndoManager::Close

-description

Closes the specified parent undo unit.

-parameters

-param pPUU [in]

A pointer to an IOleParentUndoUnit interface for the currently open parent unit to be closed.

-param fCommit [in]

Indicates whether to keep or discard the unit. If TRUE, the unit is kept in the collection. If FALSE, the unit is discarded. This parameter is used to allow the client to discard an undo unit under construction if an error or a cancellation occurs.

-returns

This method returns S_OK if the undo manager had an open parent undo unit and it was successfully closed. If the undo manager is disabled, it should immediately return S_OK and do nothing else. Other possible return values include the following.

Return code Description
S_FALSE
The parent undo unit did not have an open child and it was successfully closed.
E_INVALIDARG
If pPUU does not match the currently open parent undo unit, then implementations of this method should return E_INVALIDARG without changing any internal state unless the parent unit is blocked.

-remarks

This method is implemented the same as IOleParentUndoUnit::Close. A parent undo unit knows it is being closed when it returns S_FALSE from this method. At that time, it should terminate any communication with other objects which may be giving data to it through private interfaces.

Notes to Callers

An error return indicates a fatal error condition.

The parent unit or undo manager must accept the undo unit if fCommit is TRUE.

Note to Implementers

To process a close request, a parent undo unit first checks to see if it has an open child unit. If it does not, it returns S_FALSE.

If it does have a child unit open, it calls the IOleUndoManager::Close method on the child. If the child returns S_FALSE, then the parent undo unit verifies that pPUU points to the child unit, and closes that child undo unit. If the child returns S_OK then it handled the close internally and its parent should do nothing.

If the parent unit is blocked, it should check the pPUU parameter to determine the appropriate return code. If pPUU is pointing to itself, then it should return S_FALSE.

Otherwise, it should return S_OK; the fCommit parameter is ignored; and no action is taken.

If pPUU does not match the currently open parent undo unit, then implementations of this method should return E_INVALIDARG without changing any internal state. The only exception to this is if the unit is blocked.

-see-also

IOleParentUndoUnit::Close

IOleUndoManager