<< Return to Main Index

< Return to Class Index

CGXLongOperation Class Members

Construction

CGXLongOperation Creates a new CGXLongOperation object and increases the operation level.

Control Factory

ImplementLongOperation Select "LongOperation" in Control Factory Wizard to make the concrete implementation of the long operation mechanism available to your application.

Settings

SetTicksFirstTime Specify number of ticks necessary until wait cursor is displayed and windows messages will be processed (default: 1500).
SetTicksContinued Specify number of ticks between processing windows messages (default: 750).
SetDefaultStatusText Specify the status text to be displayed by default. Normally “Processing...”.
SetDefaultDoneText Specify the status text to be displayed when operation is finished. Normally contains “Done...”.
SetDefaultCancelText Specify the text to be appended to the status text to indicate to the user that he can abort the operation. Normally contains “Press ESC to cancel”.

Status text

GetStatusText Returns a pointer to the status text for the current operation.
SetStatusText Specify the status text for the operation. If you have locked a lower operation level, this call will have no effect.
FreeStatusText Resets the status text for the current level.
SetPercentDone Specifies the value of percentage completed. If you specify a value not equal to -1, this value will be displayed in the status bar.
SetUpdateStatusBar Specifies if a WM_SETMESSAGESTRING should be sent to the status bar automatically.
SetResetStatusBar Specifies if the status bar should be cleared when the operation is finished. An operation is assumed to be finished when the destructor for CGXLongOperation object with the lowest operation level is called.
SetFrameWnd Specifies the frame window with the status bar. All status bar messages will be sent to this window. If no frame window is specified all messages will be sent to the mainframe window (see AfxGetMainWnd) by default.

Abort Options / State

SetAbortDialog Specifies if CGXLongOperation should display a dialog when the user has pressed ESC.
SetAbortString Specifies the text to be displayed in abort-dialog box if the user has pressed ESC. Normally contains “Do you want to abort this operation?”.
SetCanRollback Specifies if the user can rollback the operation.
SetCanAbort Specifies if the user can abort the operation.
GetAbortConfirmedState Determines if the user has pressed Abort in the abort-dialog box.
GetRollbackConfirmedState Determines if the user has pressed Rollback in the abort-dialog box.

Locking

SetLockedState Call this method if you want to lock or unlock the current operation level. If you lock an operation level, higher levels will not be able to change the status text.
GetLockedState Returns the locked state. If an operation is locked, the text for the status bar cannot be changed.
GetCurrentLevel Returns the current operation level.
GetTickCount Returns the number of ticks for the current operation level.
GetWaitCursorState Determines if the cursor has been changed to a wait cursor.

Processing messages

NeedMessages You should call this method frequently to check if messages should be processed. The method determines the number of ticks since the last call to DoMessages and compares it with the value specified with SetTicksFirstTime / SetTicksContinued.
DoMessages Process windows messages and check if user has pressed ESC. Mouse messages and keyboard events will be eaten.

CGXLongOperation

Class Overview