How to rollback commands
Hi All,
I am working with anchoring an item and creating hyperlink for that item. For this I am processing kCreateAnchoredObjectCmdBoss, kNewHyperlinkPgItemSourceCmdBoss, kImportCmdBoss commands using CmdUtils::ProcessCommand(). After Import I do some resizing with the imported object.
In this process after kImportCmdBoss command is completed, I perform some checks and want to do a rollback of all commands performed till now. i.e. after rollback document state should be what it was before kCreateAnchoredObjectCmdBoss, kNewHyperlinkPgItemSourceCmdBoss, kImportCmdBoss processed.
how to do auto rollback or call undo commands ?
In the Programming Guide, I read the whole text under "Undo and Redo Commands". It says all undoable commands manages ICmdHistory. Do I need to implement a custom Interface which inherits from ICmdHistory ?
I have tried using CmdUtils::BeginCommandSequence(), CmdUtils::AbortCommandSequence()and CmdUtils::EndCommandSequence() methods, these didn't work. Can anybody help me?