Can someone explain the difference between a C++ exception and a structured exception in MFC?
You actually have three mechanisms:
try
/catch
)__try
/ __except
)TRY
, CATCH
- built on top of SEH / C++ exceptions - see also TheUndeadFish's comment) C++ exceptions usually guarantee automatic cleanup during stack unwinding (i.e. destructors of local objects run), the other mechanisms don't.
C++ exceptions only occur when they are explicitly thrown. Structured Exceptions may occur for many operations, e.g. due to undefined behavior, passing invalid pointers to APIs, unmounting the backing store of a memory mapped file, and many more.
MFC did introduce the exception macros to support exceptions even if compilers didn't implement them.