<< Return to Main Index

< Return to Class Index

CGXLongOperation::GetAbortConfirmedState

static BOOL GetAbortConfirmedState();

Return Value

TRUE if user did confirm aborting the operation; FALSE otherwise.

Remarks

Determines whether the user has pressed Abort in the abort-dialog box.

You should call GetAbortConfirmedState after DoMessages did abort, e.g.:

   TRY
   {                             
      BOOL bAbort = FALSE;

       while (bStatementsToProcess)
       {
         // check, if user pressed ESC to cancel
         if (theOp.NeedMessages())
         {
            theOp.SetPercentDone(nPercentDone);
            theOp.DoMessages(bAbort);

            if (bAbort)
               AfxThrowUserException();
         }
      }

      // operation executed successfully
      // cleanup
   }
   CATCH(CUserException, e)
   {
      if (theOp.GetAbortConfirmedState())
      {
         // user did select "Abort" in the Abort-dialog box
         // So, abort the operation and
         // cleanup
      }
      ...
   }

See Also

CGXLongOperation::DoMessages CGXLongOperation::SetCanAbort CGXLongOperation::GetRollbackConfirmedState

CGXLongOperation

Class Overview | Class Members