|
| StructuredExceptionAsCppException |
UserPreferences |
| serious-code.net | RecentChanges | ±â¼úÀÚ·á | ¸µÅ© | TitleIndex | ºí·Î±× |
#ifndef INCLUDED_SEEXCEPTION_H
#define INCLUDED_SEEXCEPTION_H
#include <eh.h>
// Maps a Win32 structured exception to a C++ exception.
// Useful to trap things like access violations.
class SeException
{
private:
unsigned int m_se;
public:
SeException(unsigned int n) : m_se(n) {}
~SeException() {}
public:
unsigned int GetSeNumber() { return m_se; }
// Call this function to start the mapping
static void Init() {
static bool g_Init = false;
if (!g_Init) {
_set_se_translator(Translator);
g_Init = true;
}
}
private:
SeException() {}
SeException( SeException& ) {}
static void Translator( unsigned int u, _EXCEPTION_POINTERS* pExp ) {
throw SeException(u);
}
};
#endif // INCLUDED_SEEXCEPTION_H À§ Ŭ·¡½º¿¡¼ ÇÙ½ÉÀÌ µÇ´Â °ÍÀº