#include "ltwrappr.h"

virtual L_INT LAnnAutomation::AddUndoNode()

Manually adds an undo node to the automation object.



The function was successful.

< 1

An error occurred. Refer to Return Codes.


This function allows you to programmatically add a node to the undo stack maintained by the automation object hObject. This function can only be called for automation objects.

This function should be called before making any changes programmatically to the objects inside the container linked to the automation object. That way, these changes can be reversed using the Undo menu brought up by the automation or by calling LAnnAutomation::Undo.

The number of actions that can be undone should be set with LAnnAutomation::SetUndoDepth before calling this function.

Calling LAnnAutomation::SetAutoUndoEnable(FALSE) disables the undo mechanism of the automation object. Therefore the automation object cannot change the undo stack until the undo mechanism is enabled by calling LAnnAutomation::SetAutoUndoEnable(TRUE).

ERROR_NO_UNDO_STACK will be returned if LAnnAutomation::SetUndoDepth has not been called before this function or if LAnnAutomation::SetUndoDepth has been called with uUndoLevels set to 0.

ERROR_UNDO_DISABLED will be returned if the undo has been disabled by calling LAnnAutomation::SetAutoUndoEnable(hObject, FALSE).

Basically, the process is as follows:


Call LAnnAutomation::SetUndoDepth to set the number of undo actions that can take place.


Call LAnnAutomation::AddUndoNode to add an undo node to the automation object.


Disable the undo feature by calling LAnnAutomation::SetAutoUndoEnable (FALSE).


Perform the operations to be combined into one undo.


Re-enable the undo feature by calling LAnnAutomation::SetAutoUndoEnable (TRUE).

Now, all three operations can be undone with one call to LAnnAutomation::Undo instead of three calls to LAnnAutomation::Undo.

Required DLLs and Libraries


For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.


Win32, x64.

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C++ Class Library Help