How to perform the Undo function

HI
I mean how to cancel the current operation.Is there a c++ sdk function?

I don’t understand what you are asking. If you want to exit your command, just return out of the function.