Share via


CDataExchange::Fail

The framework calls this member function when a dialog data validation (DDV) operation fails.

void Fail( );

Remarks

Fail restores the focus and selection to the control whose validation failed (if there is a control to restore). Fail then throws an exception of type CUserException to stop the validation process. The exception causes a message box explaining the error to be displayed. After DDV validation fails, the user can reenter data in the offending control.

Implementors of custom DDV routines can call Fail from their routines when a validation fails.

For more information on writing your own DDX and DDV routines, see Technical Note 26. For an overview of DDX and DDV, see Dialog Data Exchange and Validation and Dialog Box Topics.

Requirements

Header: afxwin.h

See Also

Reference

CDataExchange Class

Hierarchy Chart

CDataExchange::PrepareCtrl

CDataExchange::PrepareEditCtrl