Click here to Skip to main content
15,897,187 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Array Pin
Chris Losinger23-Jun-10 3:58
professionalChris Losinger23-Jun-10 3:58 
QuestionException Handling in C++ Pin
theCPkid23-Jun-10 2:04
theCPkid23-Jun-10 2:04 
AnswerRe: Exception Handling in C++ Pin
Richard MacCutchan23-Jun-10 3:02
mveRichard MacCutchan23-Jun-10 3:02 
AnswerRe: Exception Handling in C++ Pin
Emilio Garavaglia23-Jun-10 4:47
Emilio Garavaglia23-Jun-10 4:47 
AnswerRe: Exception Handling in C++ Pin
Aescleal23-Jun-10 7:10
Aescleal23-Jun-10 7:10 
GeneralRe: Exception Handling in C++ Pin
VeganFanatic25-Jun-10 16:11
VeganFanatic25-Jun-10 16:11 
GeneralRe: Exception Handling in C++ Pin
Aescleal25-Jun-10 20:17
Aescleal25-Jun-10 20:17 
GeneralRe: Exception Handling in C++ Pin
Stephen Hewitt27-Jun-10 18:13
Stephen Hewitt27-Jun-10 18:13 
In general I don't approve of this use of catch (...). As with any rule of thumb there are exceptions but here's my policy on catch (...):


  In general you should only catch what you expect could be thrown because catching an unknown exception could result in continued execution when the application is in an inconsistent state. Since catch (...) catches everything it should be avoid. One notable exception is the pattern shown below:
try
{
}
catch (...)
{
   // Cleanup resources.
   throw; // Re-throw.
}


Also note that by not using catch (...) or using it only when re-throwing means that the call stack to the unexpected exception is available in the crash dump. Another pitfall is centred around the /EH[^] switch, or older MS compilers, but I won't go into that now.
 
Steve

GeneralRe: Exception Handling in C++ Pin
Aescleal28-Jun-10 6:09
Aescleal28-Jun-10 6:09 
GeneralRe: Exception Handling in C++ Pin
Stephen Hewitt28-Jun-10 15:00
Stephen Hewitt28-Jun-10 15:00 
GeneralRe: Exception Handling in C++ Pin
theCPkid29-Jun-10 3:20
theCPkid29-Jun-10 3:20 
GeneralRe: Exception Handling in C++ Pin
Stephen Hewitt1-Jul-10 14:31
Stephen Hewitt1-Jul-10 14:31 
GeneralRe: Exception Handling in C++ Pin
theCPkid1-Jul-10 17:45
theCPkid1-Jul-10 17:45 
GeneralRe: Exception Handling in C++ Pin
Stephen Hewitt1-Jul-10 17:59
Stephen Hewitt1-Jul-10 17:59 
GeneralRe: Exception Handling in C++ Pin
theCPkid1-Jul-10 19:03
theCPkid1-Jul-10 19:03 
GeneralRe: Exception Handling in C++ Pin
Stephen Hewitt1-Jul-10 19:38
Stephen Hewitt1-Jul-10 19:38 
GeneralRe: Exception Handling in C++ Pin
Aescleal29-Jun-10 7:01
Aescleal29-Jun-10 7:01 
GeneralRe: Exception Handling in C++ Pin
Stephen Hewitt1-Jul-10 14:17
Stephen Hewitt1-Jul-10 14:17 
GeneralRe: Exception Handling in C++ Pin
theCPkid1-Jul-10 19:06
theCPkid1-Jul-10 19:06 
AnswerRe: Exception Handling in C++ [modified] Pin
theCPkid29-Jun-10 3:11
theCPkid29-Jun-10 3:11 
QuestionCRecordset old data problem Pin
eyalle23-Jun-10 0:29
eyalle23-Jun-10 0:29 
AnswerRe: CRecordset old data problem Pin
loyal ginger23-Jun-10 1:52
loyal ginger23-Jun-10 1:52 
GeneralRe: CRecordset old data problem Pin
eyalle23-Jun-10 2:14
eyalle23-Jun-10 2:14 
QuestionRe: CRecordset old data problem Pin
David Crow23-Jun-10 3:48
David Crow23-Jun-10 3:48 
QuestionPure virtual destructor ? Pin
krishna_CP23-Jun-10 0:17
krishna_CP23-Jun-10 0:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.