diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-10-25 06:42:33 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-10-25 06:42:33 +0000 |
commit | 8078782ed4e41ee3f06bf2eba42ce6b96d7a0618 (patch) | |
tree | 5d90498e0d6430025e4396cff9561b69a78a286a /ace/Object_Manager.cpp | |
parent | c0317fdfba981b96525ca700ac2885ee07e67584 (diff) | |
download | ATCD-8078782ed4e41ee3f06bf2eba42ce6b96d7a0618.tar.gz |
ChangeLogTag:Tue Oct 24 23:14:55 2000 Darrell Brunsch <brunsch@uci.edu>
Diffstat (limited to 'ace/Object_Manager.cpp')
-rw-r--r-- | ace/Object_Manager.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ace/Object_Manager.cpp b/ace/Object_Manager.cpp index 25a023e2547..6c68a902649 100644 --- a/ace/Object_Manager.cpp +++ b/ace/Object_Manager.cpp @@ -187,6 +187,21 @@ ACE_Object_Manager::shutting_down (void) return ACE_Object_Manager::instance_ ? instance_->shutting_down_i () : 1; } +#if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) +// Instead of popping up a window for exceptions, just print something out +LONG _stdcall ACE_UnhandledExceptionFilter (PEXCEPTION_POINTERS pExceptionInfo) +{ + DWORD dwExceptionCode = pExceptionInfo->ExceptionRecord->ExceptionCode; + + if (dwExceptionCode == EXCEPTION_ACCESS_VIOLATION) + ACE_ERROR ((LM_ERROR, "\nERROR: ACCESS VIOLATION\n")); + else + ACE_ERROR ((LM_ERROR, "\nERROR: UNHANDLED EXCEPTION\n")); + + return EXCEPTION_EXECUTE_HANDLER; +} +#endif /* ACE_DISABLE_WIN32_ERROR_WINDOWS */ + // Initialize an ACE_Object_Manager. There can be instances of this object // other than The Instance. This can happen if a user creates one for some // reason. All objects set up their per-object information and managed @@ -254,6 +269,17 @@ ACE_Object_Manager::init (void) ACE_TSS_Emulation::tss_open (ts_storage_); # endif /* ACE_HAS_TSS_EMULATION */ +#if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) + // This will keep the ACE_Assert window + _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); + _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR ); + + // And this will catch all unhandled exceptions. + SetUnhandledExceptionFilter (&ACE_UnhandledExceptionFilter); +#endif /* ACE_DISABLE_WIN32_ERROR_WINDOWS */ + + + # if !defined (ACE_LACKS_ACE_SVCCONF) ACE_NEW_RETURN (preallocations_, ACE_Object_Manager_Preallocations, |