Undoes the last automation operation performed in the active automation container.
#include "ltwrappr.h"
L_INT LAutomation::Undo (dwFlags=0);
Reserved for future use. Must be 0.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
LAutomation::Undo must be called at least once in order to perform a "redo" using LAutomation::Redo.
To determine the current undo level call LAutomation::GetUndoLevel.
To change the undo level call LAutomation::SetUndoLevel.
To determine whether an automation operation can be undone, call LAutomation::CanUndo.
For information about grouping multiple operations into a single undo process, refer to LAutomation::AddUndoNode.
This example shows how to undo the last automation operation.
L_INT LAutomation_UndoExample(LAutomation &lauto)
{
L_INT nRet;
nRet = lauto.IsValid ();
if ( nRet == SUCCESS ) /* check the validity of the automation handle */
{
L_BOOL fCanUndo ;
/* Query the ability of undoing */
fCanUndo = lauto.CanUndo () ;
if ( fCanUndo )
{
/* undo the last automation operation */
nRet = lauto.Undo () ;
if(nRet != SUCCESS)
return nRet;
}
}
else
{
return nRet;
}
return SUCCESS ;
}