Catching Structure Exceptions in C++ EH 
Author Message
 Catching Structure Exceptions in C++ EH

On CE.NET 4.1 is it possible to resolve structured exceptions within a C++
exception handler catch(...) ?  I have done this on the PC using
_set_se_translator is this possible in CE.NET 4.1? Or are there any other
options?

Thanks.



Fri, 23 Sep 2005 07:42:06 GMT  
 Catching Structure Exceptions in C++ EH
The Windows CE runtime library does not support _set_se_translator at this
time.  The only workaround I know of is to separate the code that could
cause a structured exception into a different function.  Something like:

#include <windows.h>
#include <exception>

void se_perpetrator() {
  __try {
    *(int*)0 = 0;
  } __except(EXCEPTION_EXECUTE_HANDLER) {
    throw (std::exception("ACCESS VIOLATION"));
  }

Quote:
}

void eh_catcher(void) {
  try {
    se_perpetrator();
  } catch (std::exception e) {
    printf("%s\n", e.what());
  }

Quote:
}

int main() {
  eh_catcher();
  return 0;

Quote:
}

--
Russ Keldorph

me.)

This posting is provided "AS IS" with no warranties, and confers no rights.
OR if you wish to include a script sample in your post please add "Use of
included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"


Quote:
> On CE.NET 4.1 is it possible to resolve structured exceptions within a C++
> exception handler catch(...) ?  I have done this on the PC using
> _set_se_translator is this possible in CE.NET 4.1? Or are there any other
> options?

> Thanks.



Sat, 24 Sep 2005 01:17:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Catching Win32 exceptions with a C++ catch-block

2. Catching hardware exceptions using C++ exceptions

3. Catching SEC Exceptions as C++ Exceptions

4. Win32 structured exceptions vs C++ exceptions

5. Exceptions : Combining C++ and Structured Exception Handling ?

6. WinCE.NET STD SDK MFC comipled with non-C++ exception EH implementations

7. catching Win32 API exceptions in C++

8. Howto catch Win32 exceptions in C++?

9. catching math exceptions with C++

10. Catching SEH and c++ exception

11. Q: Why try catch cannot catch the exception

12. C++/MFC and exceptions- catch(...)=bad?

 

 
Powered by phpBB® Forum Software