What are the differences between MFC Exception macros and
C++ exception keywords?

Answers were Sorted based on User's Feedback



What are the differences between MFC Exception macros and C++ exception keywords?..

Answer / hemalatha

The main difference between the macros and the keywords is
that the macros "automatically" delete a caught exception
when the exception goes out of scope. Code using the
keywords does not; exceptions caught in a catch block must
be explicitly deleted. Mixing macros and C++ exception
keywords can cause memory leaks when an exception object is
not deleted, or heap corruption when an exception is
deleted twice.

Is This Answer Correct ?    3 Yes 0 No

What are the differences between MFC Exception macros and C++ exception keywords?..

Answer / mullaikani

Class macros — TRY, CATCH, THROW, and so on — to use the C++
exception-handling keywords try, catch, and throw.
The major difference between the macros and the keywords is
that code using the macros "automatically" deletes a caught
exception when the exception goes out of scope. Code using
the keywords does not, so you must explicitly delete a
caught exception.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More MFC Interview Questions

How you find memory leaks?

4 Answers   ABB,


What is mfc class hierarchy?

0 Answers  


What is the use of OninitDialog ?

11 Answers   HCL, Nagarro,


What is CALLBACK? How it work? what is the advantage of CALLBACK, please explain with an example

6 Answers  


Explain about MDI and CMultiDocTemplate ?

2 Answers  


what is the use of CWinApp class?

3 Answers   Mphasis,


what is the difference between compiling and building?

1 Answers  


1)dynamic creation of a Button ?

2 Answers   TCS,


Types of DLL's

11 Answers   Invensys,


How do you change the properties for a tree view control that is part of the CTreeView class?

1 Answers  


What is the use of CCmdTarget ?

4 Answers  


what if we provide two message handler for same message ?

1 Answers  


Categories