Click here to Skip to main content
15,918,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DVD burning problem using windows XP Service pack2 Pin
raj157619-Apr-10 23:17
raj157619-Apr-10 23:17 
GeneralRe: DVD burning problem using windows XP Service pack2 Pin
Michel Godfroid19-Apr-10 23:46
Michel Godfroid19-Apr-10 23:46 
GeneralRe: DVD burning problem using windows XP Service pack2 Pin
raj157620-Apr-10 0:41
raj157620-Apr-10 0:41 
GeneralRe: DVD burning problem using windows XP Service pack2 Pin
Michel Godfroid20-Apr-10 1:02
Michel Godfroid20-Apr-10 1:02 
AnswerRe: DVD burning problem using windows XP Service pack2 Pin
Moak20-Apr-10 0:53
Moak20-Apr-10 0:53 
QuestionListview header mouse click Pin
arun_pk19-Apr-10 20:08
arun_pk19-Apr-10 20:08 
AnswerRe: Listview header mouse click Pin
Stephen Hewitt19-Apr-10 20:58
Stephen Hewitt19-Apr-10 20:58 
AnswerRe: Listview header mouse click Pin
KarstenK19-Apr-10 21:00
mveKarstenK19-Apr-10 21:00 
QuestionMonitoring received packets on app which uses IOCP(hooking) Pin
l0odi19-Apr-10 18:51
l0odi19-Apr-10 18:51 
AnswerRe: Monitoring received packets on app which uses IOCP(hooking) Pin
l0odi21-Apr-10 6:10
l0odi21-Apr-10 6:10 
Questionhow to embed the window of my program in the desktop?(The window is showed under the desktop icons.) Pin
letianzhu19-Apr-10 17:50
letianzhu19-Apr-10 17:50 
AnswerRe: how to embed the window of my program in the desktop?(The window is showed under the desktop icons.) Pin
Code-o-mat19-Apr-10 21:42
Code-o-mat19-Apr-10 21:42 
GeneralRe: how to embed the window of my program in the desktop?(The window is showed under the desktop icons.) Pin
Stephen Hewitt19-Apr-10 21:57
Stephen Hewitt19-Apr-10 21:57 
AnswerRe: how to embed the window of my program in the desktop?(The window is showed under the desktop icons.) Pin
Michel Godfroid20-Apr-10 3:20
Michel Godfroid20-Apr-10 3:20 
GeneralRe: how to embed the window of my program in the desktop?(The window is showed under the desktop icons.) Pin
letianzhu20-Apr-10 4:55
letianzhu20-Apr-10 4:55 
QuestionWinSock 2 + UNICODE / Win32 Pin
Fareed Rizkalla19-Apr-10 11:22
Fareed Rizkalla19-Apr-10 11:22 
AnswerRe: WinSock 2 + UNICODE / Win32 Pin
Richard MacCutchan19-Apr-10 11:46
mveRichard MacCutchan19-Apr-10 11:46 
GeneralRe: WinSock 2 + UNICODE / Win32 Pin
Stephen Hewitt19-Apr-10 14:41
Stephen Hewitt19-Apr-10 14:41 
GeneralRe: WinSock 2 + UNICODE / Win32 Pin
Fareed Rizkalla19-Apr-10 15:45
Fareed Rizkalla19-Apr-10 15:45 
Question[SOLVED]Problem using dmColor member of DEVMODE struct [modified] Pin
hhh19-Apr-10 7:14
hhh19-Apr-10 7:14 
QuestionUnhandled exception Pin
PankajB19-Apr-10 5:59
PankajB19-Apr-10 5:59 
AnswerRe: Unhandled exception Pin
Richard MacCutchan19-Apr-10 6:14
mveRichard MacCutchan19-Apr-10 6:14 
GeneralRe: Unhandled exception Pin
PankajB19-Apr-10 6:50
PankajB19-Apr-10 6:50 
GeneralRe: Unhandled exception Pin
Richard MacCutchan19-Apr-10 6:57
mveRichard MacCutchan19-Apr-10 6:57 
AnswerRe: Unhandled exception Pin
Stephen Hewitt19-Apr-10 14:09
Stephen Hewitt19-Apr-10 14:09 
In general the best thing to do with an access violation in some DLL you don't have source code for is to crash. It's amateurish to think that catching it solves any problems. If you think about it, it's self evident:

  1. Something went wrong.
  2. The unexpected event happened part way though a sequence of steps that probably should have been atomic.

I'll give some specific examples of the kind of problems that could occur:

  1. You were adding a node to a double-linked list when the access violation occurred. Now you have a node that is only partially linked in. Instead of crashing at the point of insertion you crash down the track when iterating over the list.
  2. The access violation happens after a call to EnterCriticalSection but before the corresponding LeaveCriticalSection. Instead of crashing at the problem location an entirely different thread now locks up.
  3. The crash was the last of a series of memory accesses of which some of the earlier ones (that didn't cause a crash) corrupted the heap. You'll now crash at some later time when allocating or freeing memory.


You could come up with a million of these examples. In most cases "recovering" from low-level exceptions by catching them turns a bad problem into a worse one. Sometimes crashing is a feature; don't make things worse trying to "fix" things.

You may already know all this (you did mention something about terminating correctly), but I thought it best to point out just in case. There's also the fact that moving the manifestation of a problem (a crash) even slightly from the source of the problem makes it many times harder to fix in future.
Steve

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.