Available in LEADTOOLS Document and Medical Imaging toolkits.
AnnUndoDepth example for C++ 4.0 and later
// This example increases the length of the undo stack
m_Lead1.SetAnnUndoDepth(m_Lead1.GetAnnUndoDepth() + 5);