try/catch vs TRY/CATCH

try/catch vs TRY/CATCH

Post by Adee » Fri, 26 May 2006 06:57:01


Hi,

What is in your opinion the preferred way of doing exception handling
for MFC objects (such as the CFile)... the try/catch mechanism or the
MFC based TRY/CATCH macros?

Thanks
Adeel
 
 
 

try/catch vs TRY/CATCH

Post by Jonathan W » Fri, 26 May 2006 07:15:00

Use try/catch. I don't recall what TRY/CATCH does but, basically, that was
provided before VC++ had full support fro try/catch.

--
Jonathan Wood
SoftCircuits Programming
http://www.yqcomputer.com/

 
 
 

try/catch vs TRY/CATCH

Post by Doug Harri » Fri, 26 May 2006 12:58:22


TRY/CATCH have been implemented in terms of try/catch since VC 2.0, which
was the first version to support C++ exceptions. Prior to that, they were
implemented in terms of setjmp/longjmp, which didn't support stack
unwinding. Just use try/catch.

--
Doug Harrison
Visual C++ MVP