Controls whether the system or the process handles the specified serious error types.
SyntaxUINT SetErrorMode(
[in] UINT uMode
);
Parameters
[in] uMode
The process error mode. This parameter can be one or more of the following values.
Value MeaningBest practice is that all applications call the process-wide SetErrorMode function with a parameter of SEM_FAILCRITICALERRORS at startup. This is to prevent error mode dialogs from hanging the application.
After this value is set for a process, subsequent attempts to clear the value are ignored.
The return value is the previous state of the error-mode bit flags.
Each process has an associated error mode that indicates to the system how the application is going to respond to serious errors. A child process inherits the error mode of its parent process. To retrieve the process error mode, use the GetErrorMode function.
Because the error mode is set for the entire process, you must ensure that multi-threaded applications do not set different error-mode flags. Doing so can lead to inconsistent error handling.
The system does not make alignment faults visible to an application on all processor architectures. Therefore, specifying SEM_NOALIGNMENTFAULTEXCEPT is not an error on such architectures, but the system is free to silently ignore the request. This means that code sequences such as the following are not always valid on x86 computers:
C++SetErrorMode(SEM_NOALIGNMENTFAULTEXCEPT); fuOldErrorMode = SetErrorMode(0); ASSERT(fuOldErrorMode == SEM_NOALIGNMENTFAULTEXCEPT);Itanium:
An application must explicitly call
SetErrorModewith SEM_NOALIGNMENTFAULTEXCEPT to have the system automatically fix alignment faults. The default setting is for the system to make alignment faults visible to an application.
Visual Studio 2005: When declaring a pointer to a structure that may not have aligned data, you can use the __unaligned keyword to indicate that the type must be read one byte at a time. For more information, see Windows Data Alignment.
Windows 7: Callers should favor SetThreadErrorMode over SetErrorMode since it is less disruptive to the normal behavior of the system.
Requirements Requirement Value Minimum supported client Windows XP [desktop apps | UWP apps] Minimum supported server Windows Server 2003 [desktop apps | UWP apps] Target Platform Windows Header errhandlingapi.h (include Windows.h) Library Kernel32.lib DLL Kernel32.dll See alsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4