Click here to Skip to main content
15,894,330 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Not catching the exception Pin
gsainath4u27-May-10 23:58
gsainath4u27-May-10 23:58 
GeneralRe: Not catching the exception Pin
Code-o-mat28-May-10 0:05
Code-o-mat28-May-10 0:05 
AnswerRe: Not catching the exception Pin
sashoalm27-May-10 22:33
sashoalm27-May-10 22:33 
GeneralRe: Not catching the exception Pin
Aescleal27-May-10 22:43
Aescleal27-May-10 22:43 
GeneralRe: Not catching the exception Pin
gsainath4u27-May-10 22:59
gsainath4u27-May-10 22:59 
AnswerRe: Not catching the exception Pin
Stephen Hewitt28-May-10 0:08
Stephen Hewitt28-May-10 0:08 
GeneralRe: Not catching the exception Pin
gsainath4u28-May-10 0:28
gsainath4u28-May-10 0:28 
GeneralRe: Not catching the exception Pin
Emilio Garavaglia28-May-10 2:04
Emilio Garavaglia28-May-10 2:04 
No ... that's not a good solution.
If the file is corrupted you must be able to understand the corruption while reading the file, and throw yourself an exception if you cannot recover (and then handle the exception properly)

Doing the way you think may not working as expected.
If you are lucky, some pointer can be null, and an hardware exception is thrown during dereference, and you can catch it either using catch(...) or using the OS API support.
But if you're not, some pointer may be wrong, but still valid (I mean: pointing to something different to what it should be expected, but still inside your program memory space), hence dereferencing them doesn't throw anything. It simple made wrong results the user may even not recognize (and are the most subtle bug to fix).

Catching a bad dereference in case of data corruption to avoid a crash is not the solution. It's just an illusion to solve the problem, that may have also other consequences.

2 bugs found.
> recompile ...
65534 bugs found.
D'Oh! | :doh:


GeneralRe: Not catching the exception Pin
sashoalm28-May-10 2:21
sashoalm28-May-10 2:21 
GeneralRe: Not catching the exception Pin
Stephen Hewitt28-May-10 5:08
Stephen Hewitt28-May-10 5:08 
QuestionResizing image Pin
learningvisualc27-May-10 20:48
learningvisualc27-May-10 20:48 
AnswerRe: Resizing image Pin
Code-o-mat27-May-10 21:21
Code-o-mat27-May-10 21:21 
AnswerRe: Resizing image Pin
CPallini27-May-10 21:31
mveCPallini27-May-10 21:31 
AnswerRe: Resizing image Pin
Anu Koshy1-Jun-10 23:35
Anu Koshy1-Jun-10 23:35 
QuestionCompiling C programs in VS.NET 2005 Pin
Sadheesh R27-May-10 20:13
Sadheesh R27-May-10 20:13 
AnswerRe: Compiling C programs in VS.NET 2005 Pin
Cedric Moonen27-May-10 20:21
Cedric Moonen27-May-10 20:21 
AnswerRe: Compiling C programs in VS.NET 2005 Pin
Aescleal27-May-10 20:56
Aescleal27-May-10 20:56 
GeneralRe: Compiling C programs in VS.NET 2005 Pin
Sadheesh R27-May-10 22:47
Sadheesh R27-May-10 22:47 
GeneralRe: Compiling C programs in VS.NET 2005 Pin
Aescleal27-May-10 23:20
Aescleal27-May-10 23:20 
GeneralRe: Compiling C programs in VS.NET 2005 Pin
Sadheesh R27-May-10 23:37
Sadheesh R27-May-10 23:37 
GeneralRe: Compiling C programs in VS.NET 2005 Pin
Aescleal27-May-10 23:43
Aescleal27-May-10 23:43 
QuestionEdit Selection Color Pin
john563227-May-10 19:38
john563227-May-10 19:38 
AnswerRe: Edit Selection Color Pin
john563228-May-10 2:09
john563228-May-10 2:09 
QuestionHow to save unicode text in the source code of vc++ 6.0 IDE Pin
Jayapal Chandran27-May-10 19:07
Jayapal Chandran27-May-10 19:07 
AnswerRe: How to save unicode text in the source code of vc++ 6.0 IDE Pin
Stephen Hewitt27-May-10 19:37
Stephen Hewitt27-May-10 19:37 

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.