Handle C++ exception and structured exception together

This is a discussion on Handle C++ exception and structured exception together within the C++ Programming forums, part of the General Programming Boards category; Hello everyone, I am learning set_se_translator, and there are some good resources about how to translate structured exception into C++ ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    Handle C++ exception and structured exception together

    Hello everyone,


    I am learning set_se_translator, and there are some good resources about how to translate structured exception into C++ exception, like,

    http://www.codeproject.com/KB/cpp/seexception.aspx

    1.

    What makes me confused is, when we are talking about translate, it means both structured exception and C++ exception may occur in a C++ program, right?

    2.

    But from build option, we can select either /EHa or /EHsc, means we can only select one type of exception, either asynchronous (structured) or synchronous (C++ exception).

    (1) and (2) are conflict?


    thanks in advance,
    George

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    No, you misunderstand the build option. The build option is about whether it should catch SEs with a C++ catch and what assumptions the compiler can make.

    Have you read this?
    http://msdn2.microsoft.com/en-us/library/5skw957f.aspx
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks CornedBee,


    I have read through the link and I think it means both exceptions (structured and C++) exist in C++ application, and /EHa or /EHsc does not determine whether they exist or not, and only determine whether we handle structured or C++ exception, right?

    Quote Originally Posted by CornedBee View Post
    No, you misunderstand the build option. The build option is about whether it should catch SEs with a C++ catch and what assumptions the compiler can make.

    Have you read this?
    http://msdn2.microsoft.com/en-us/library/5skw957f.aspx

    regards,
    George

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. exception from C function?
    By George2 in forum C++ Programming
    Replies: 52
    Last Post: 01-30-2008, 04:39 AM
  2. Try-catch works with structured exception
    By George2 in forum C++ Programming
    Replies: 22
    Last Post: 01-27-2008, 03:25 AM
  3. Structured exception
    By George2 in forum Windows Programming
    Replies: 4
    Last Post: 01-20-2008, 07:40 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21