本文整理汇总了C++中CCrashHandler类的典型用法代码示例。如果您正苦于以下问题:C++ CCrashHandler类的具体用法?C++ CCrashHandler怎么用?C++ CCrashHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CCrashHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PureCallHandler
void __cdecl CCrashHandler::PureCallHandler()
{
// Pure virtual function call
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_PURE_CALL;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例2: TerminateHandler
// CRT terminate() call handler
void __cdecl CCrashHandler::TerminateHandler()
{
// Abnormal program termination (terminate() function was called)
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_TERMINATE_CALL;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例3: SigtermHandler
// CRT SIGTERM signal handler
void CCrashHandler::SigtermHandler(int)
{
// Termination request (SIGTERM)
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_SIGTERM;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例4: crInstallToCurrentThread2
crInstallToCurrentThread2(DWORD dwFlags)
{
crSetErrorMsg(_T("Success."));
CCrashHandler *pCrashHandler =
CCrashHandler::GetCurrentProcessCrashHandler();
if(pCrashHandler==NULL)
{
// AS: Correction of error message
crSetErrorMsg(_T("Crash handler not installed for this process."));
return 1;
}
int nResult = pCrashHandler->SetThreadExceptionHandlers(dwFlags);
if(nResult!=0)
return 2; // Error?
// Ok.
return 0;
}
示例5: UnexpectedHandler
// CRT unexpected() call handler
void __cdecl CCrashHandler::UnexpectedHandler()
{
// Unexpected error (unexpected() function was called)
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_UNEXPECTED_CALL;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例6: crUninstallFromCurrentThread
crUninstallFromCurrentThread()
{
crSetErrorMsg(_T("Success."));
CCrashHandler *pCrashHandler =
CCrashHandler::GetCurrentProcessCrashHandler();
if(pCrashHandler==NULL)
{
ATLASSERT(pCrashHandler!=NULL);
crSetErrorMsg(_T("Crash handler wasn't previously installed for current thread."));
return 1; // Invalid parameter?
}
int nResult = pCrashHandler->UnSetThreadExceptionHandlers();
if(nResult!=0)
return 2; // Error?
// OK.
return 0;
}
示例7: SigillHandler
// CRT sigill signal handler
void CCrashHandler::SigillHandler(int)
{
// Illegal instruction (SIGILL)
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_SIGILL;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
ExitProcess(1);
}
示例8: crAddVideo
crAddVideo(
DWORD dwFlags,
int nDuration,
int nFrameInterval,
SIZE* pDesiredFrameSize,
HWND hWndParent
)
{
crSetErrorMsg(_T("Unspecified error."));
CCrashHandler *pCrashHandler =
CCrashHandler::GetCurrentProcessCrashHandler();
if(pCrashHandler==NULL)
{
crSetErrorMsg(_T("Crash handler wasn't previously installed for current process."));
return 1; // Invalid parameter?
}
return pCrashHandler->AddVideo(dwFlags, nDuration, nFrameInterval, pDesiredFrameSize, hWndParent);
}
示例9: SigabrtHandler
// CRT SIGABRT signal handler
void CCrashHandler::SigabrtHandler(int)
{
// Caught SIGABRT C++ signal
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_SIGABRT;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例10: NewHandler
int __cdecl CCrashHandler::NewHandler(size_t)
{
// 'new' operator memory allocation exception
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_NEW_OPERATOR_ERROR;
ei.pexcptrs = NULL;
pCrashHandler->GenerateErrorReport(&ei);
}
exit(1); // Terminate program
}
示例11: cpp_sigsegv_handler
void cpp_sigsegv_handler(int)
{
// Invalid storage access (SIGSEGV)
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_SIGSEGV;
ei.pexcptrs = (PEXCEPTION_POINTERS)_pxcptinfoptrs;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}
示例12: crSetCrashCallbackA
crSetCrashCallbackA(
PFNCRASHCALLBACKA pfnCallbackFunc,
LPVOID lpParam
)
{
crSetErrorMsg(_T("Unspecified error."));
CCrashHandler *pCrashHandler =
CCrashHandler::GetCurrentProcessCrashHandler();
if(pCrashHandler==NULL)
{
crSetErrorMsg(_T("Crash handler wasn't previously installed for current process."));
return 1; // No handler installed for current process?
}
pCrashHandler->SetCrashCallbackA(pfnCallbackFunc, lpParam);
// OK
crSetErrorMsg(_T("Success."));
return 0;
}
示例13: Win32UnhandledExceptionFilter
LONG WINAPI Win32UnhandledExceptionFilter(PEXCEPTION_POINTERS pExceptionPtrs)
{
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_WIN32_STRUCTURED_EXCEPTION;
ei.pexcptrs = pExceptionPtrs;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
#if _MSC_VER<1300 // This is to make MSVC6.0 compiler happy
return EXCEPTION_EXECUTE_HANDLER;
#endif
}
示例14: cpp_security_handler
void __cdecl cpp_security_handler(int code, void *x)
{
// Security error (buffer overrun).
code;
x;
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_SECURITY_ERROR;
pCrashHandler->GenerateErrorReport(&ei);
}
exit(1); // Terminate program
}
示例15: cpp_sigfpe_handler
void cpp_sigfpe_handler(int /*code*/, int subcode)
{
// Floating point exception (SIGFPE)
CCrashHandler* pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler();
ATLASSERT(pCrashHandler!=NULL);
if(pCrashHandler!=NULL)
{
// Fill in the exception info
CR_EXCEPTION_INFO ei;
memset(&ei, 0, sizeof(CR_EXCEPTION_INFO));
ei.cb = sizeof(CR_EXCEPTION_INFO);
ei.exctype = CR_CPP_SIGFPE;
ei.pexcptrs = (PEXCEPTION_POINTERS)_pxcptinfoptrs;
ei.fpe_subcode = subcode;
pCrashHandler->GenerateErrorReport(&ei);
}
// Terminate program
exit(1);
}