This documentation is archived and is not being maintained.


Associates an error that is detected by run-time error checks (RTC) with a type. Your error handler will process how to output errors of the specified type.

int _RTC_SetErrorType(
   _RTC_ErrorNumber errnum,
   int ErrType 


A number between zero and one less than the value returned by _RTC_NumErrors.
A value to assign to this errnum. For example, you may use _CRT_ERROR. If you are using _CrtDbgReport as your error handler, ErrType can only be one of the symbols defined in _CrtSetReportMode. If you have your own error handler (_RTC_SetErrorFunc), you can have as many ErrTypes as there are errnums.

An ErrType of _RTC_ERRTYPE_IGNORE has special meaning to _CrtSetReportMode; the error will be ignored.

Return Value

The previous value for the error type type.


By default, all errors are set to ErrType = 1, which corresponds to _CRT_ERROR. See _CrtDbgReport for more information about the default error types such as _CRT_ERROR.

Before you can call this function, you must first call one of the run-time error check initialization functions; see Using Run-Time Checks without the C Run-Time Library


Routine Required header Compatibility
_RTC_SetErrorType <rtcapi.h> Win 98, Win Me, Win NT, Win 2000, Win XP

See Compatibility for additional information.


All versions of the C run-time libraries.

See Also

_RTC_GetErrDesc | Run-Time Error Checks Function Reference | RTC sample | Run-Time Routines and .NET Framework Equivalents