Location:
e32cmn.h
TRAPD (_r, _s) TInt _r; \
{ \
_r = 0; \
{ TRAP_INSTRUMENTATION_START; } \
try { \
__WIN32SEHTRAP \
TTrapHandler* ____t = User::MarkCleanupStack(); \
_s; \
User::UnMarkCleanupStack(____t); \
{ TRAP_INSTRUMENTATION_NOLEAVE; } \
__WIN32SEHUNTRAP \
} \
catch (XLeaveException& l) \
{ \
_r = l.GetReason(); \
{ TRAP_INSTRUMENTATION_LEAVE(_r); } \
} \
catch (...) \
{ \
User::Invariant(); \
} \
{ TRAP_INSTRUMENTATION_END; } \
}
Executes the set of C++ statements _s under a trap harness.
Use this macro in the same way as you would TRAP, except that the variable _r is defined as part of the macro (and is therefore valid for the rest of the block in which the macro occurs). Often, this saves a line of code.
|