INtime SDK Help
INtime SDK v7.1 > About INtime > INtime Kernel > Exception handling > _set_se_translator

With this function, a translator can be defined that translates a hardware exception into a type that can be specified in a catch block for C++ Exception Handling.

typedef void (__cdecl *                  _se_translator_function)(
        unsigned int,
_se_translator_function __cdecl         _set_se_translator(_se_translator_function


Pointer to an exception translator function that you write.


The _set_se_translator function provides a way to handle hardware exceptions as C++ typed exceptions. To allow each hardware exception to be handled by a C++ catch handler, first define a C exception wrapper class that can be used, or derived from, to attribute a specific class type to a C exception. To use this class, install a custom exception translator function that is called by the internal exception-handling mechanism each time a hardware exception is raised. Within your translator function, you can throw any typed exception that can be caught by a matching C++ catch handler.

You must use /EHa when using _set_se_translator.

To specify a custom translation function, call _set_se_translator with the name of your translation function as its argument. The translator function that you write is called once for each function invocation on the stack that has try blocks. There is no default translator function.

Your translator function should do no more than throw a C++ typed exception.

In a multithreaded environment, translator functions are maintained separately for each thread. Each new thread needs to install its own translator function. Thus, each thread is in charge of its own translation handling.

The seTransFunction function that you write takes an unsigned integer and a pointer to an _EXCEPTION_POINTERS structure as arguments. The arguments are the return values of calls to the API GetExceptionCode and GetExceptionInformation functions, respectively.

typedef void (*_se_translator_function)(unsigned int, struct _EXCEPTION_POINTERS* );

Return Values

Returns a pointer to the previous translator function registered by _set_se_translator, so that the previous function can be restored later. This value can be NULL.


Versions Defined in Include Link to
INtime 3.0 intime/rt/include/eh.h eh.h rt.lib


This function operates in the real-time portion of your application.

See Also

Exception handling