C++
virtual ACDBCORE2D_PORT Acad::ErrorStatus subCancel();
Description
Called from within cancel() before anything else is done. The default implementation is to return Acad::eOk. However, when overridden in custom classes, it provides a hook into the cancel operation. If it returns anything other than Acad::eOk, then the cancel operation is immediately terminated.
When overriding this function, a sequence of steps is required:
- Check to be sure everything is correct with the AcDbObject's state. If not, then immediately return a value other than Acad::eOk, which terminates the cancel operation.
- Call the parent class's subCancel(). If this returns Acad::eOk, then continue; otherwise immediately return whatever the parent class's subCancel() returned.
- Do any operations desired before the cancel operation continues.
- Return Acad::eOk to allow the cancel operation to continue normally.
When implementing your own subCancel(), it is best not to change any of the object's state at all. But, if you must, then it is best to make such changes after invoking the parent class's subCancel(), just in case it returns an error code other than Acad::eOk. If you must change state before invoking the parent class's subCancel(), you may need to reverse the changes if the parent class returns a status other than Acad::eOk.