Click here to Skip to main content
15,908,776 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:57
George_George27-Jan-08 23:57 
GeneralRe: exception and global variable Pin
Maxwell Chen28-Jan-08 0:01
Maxwell Chen28-Jan-08 0:01 
GeneralRe: exception and global variable Pin
Rajesh R Subramanian27-Jan-08 23:34
professionalRajesh R Subramanian27-Jan-08 23:34 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:38
George_George27-Jan-08 23:38 
JokeRe: exception and global variable Pin
CPallini27-Jan-08 23:47
mveCPallini27-Jan-08 23:47 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:54
George_George27-Jan-08 23:54 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:57
Maxwell Chen27-Jan-08 23:57 
GeneralRe: exception and global variable Pin
Cedric Moonen27-Jan-08 23:13
Cedric Moonen27-Jan-08 23:13 
Did you even read his post ?
The problem is simply that if the constructor throws an exception, you'll never be able to catch it if it is a global object. That's what the author was speaking about. Not about something that you can catch in your constructor.

What's the point of your example ?? You throw something that is caught two lines under. Why do you need to throw an exception for such a thing ? That's just totally not adapted.
But now, how can you inform the users of your object that something went wrong during construction of the object ? Well, in general you throw an exception out of your constructor.

Cédric Moonen
Software developer

Charting control [v1.2]

GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:24
George_George27-Jan-08 23:24 
GeneralRe: exception and global variable Pin
Cedric Moonen27-Jan-08 23:34
Cedric Moonen27-Jan-08 23:34 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:53
George_George27-Jan-08 23:53 
GeneralRe: exception and global variable Pin
Cedric Moonen28-Jan-08 0:05
Cedric Moonen28-Jan-08 0:05 
GeneralRe: exception and global variable Pin
George_George28-Jan-08 0:26
George_George28-Jan-08 0:26 
QuestionRe: exception and global variable Pin
David Crow28-Jan-08 5:08
David Crow28-Jan-08 5:08 
GeneralRe: exception and global variable Pin
George_George28-Jan-08 13:43
George_George28-Jan-08 13:43 
GeneralRe: exception and global variable Pin
David Crow28-Jan-08 15:58
David Crow28-Jan-08 15:58 
QuestionHow to access a single object from multiple thread Pin
Ranojay27-Jan-08 21:57
Ranojay27-Jan-08 21:57 
GeneralRe: How to access a single object from multiple thread Pin
Iain Clarke, Warrior Programmer27-Jan-08 22:02
Iain Clarke, Warrior Programmer27-Jan-08 22:02 
GeneralRe: How to access a single object from multiple thread Pin
Ranojay28-Jan-08 20:20
Ranojay28-Jan-08 20:20 
GeneralRe: How to access a single object from multiple thread Pin
Iain Clarke, Warrior Programmer28-Jan-08 21:50
Iain Clarke, Warrior Programmer28-Jan-08 21:50 
GeneralRe: How to access a single object from multiple thread Pin
Ranojay30-Jan-08 20:49
Ranojay30-Jan-08 20:49 
GeneralRe: How to access a single object from multiple thread Pin
Iain Clarke, Warrior Programmer30-Jan-08 21:57
Iain Clarke, Warrior Programmer30-Jan-08 21:57 
GeneralRe: How to access a single object from multiple thread Pin
Ranojay1-Feb-08 22:03
Ranojay1-Feb-08 22:03 
QuestionNetwork detection on windows 98 Pin
Somnath_Mali27-Jan-08 20:36
Somnath_Mali27-Jan-08 20:36 
QuestionRe: Network detection on windows 98 Pin
David Crow28-Jan-08 5:11
David Crow28-Jan-08 5:11 

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.