TRY/CATCH_ALL vs try/catch

后端 未结 4 1268
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-18 03:36

I\'ve been using c++ for a while, and I\'m familiar with normal try/catch. However, I now find myself on Windows, coding in VisualStudio for COM development. Several parts

4条回答
  •  忘掉有多难
    2021-01-18 04:21

    You'll want to keep in mind that there are 3 different kinds of exceptions when programming with Visual C++:

    1. C++ exceptions
    2. Structured exceptions (SEH, Windows' own exception mechanism)
    3. MFC exceptions (those you mention, which are not recommended for new code but can still be used for backwards compatibility)

    SEH and C++ exception mechanisms should not be mixed.

    This article on MSDN has more details:

    http://msdn.microsoft.com/en-us/library/x057540h.aspx

提交回复
热议问题