Click here to Skip to main content
15,913,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Interfaces to other applications Pin
Anders Molin20-Feb-03 14:07
professionalAnders Molin20-Feb-03 14:07 
GeneralRe: Interfaces to other applications Pin
User 988521-Feb-03 3:06
User 988521-Feb-03 3:06 
General"Try" to "Catch" without "Throw" Pin
Anton A. Loukine20-Feb-03 11:39
Anton A. Loukine20-Feb-03 11:39 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Dave Bryant20-Feb-03 11:51
Dave Bryant20-Feb-03 11:51 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Anton A. Loukine20-Feb-03 11:58
Anton A. Loukine20-Feb-03 11:58 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Gary R. Wheeler20-Feb-03 14:36
Gary R. Wheeler20-Feb-03 14:36 
GeneralRephrasing the question Pin
Anonymous21-Feb-03 3:18
Anonymous21-Feb-03 3:18 
GeneralRe: Rephrasing the question Pin
jhwurmbach21-Feb-03 3:34
jhwurmbach21-Feb-03 3:34 
That IS what exceptions are for in the first place.
You wrap the part you want into try{..} and catch the errors afterwards. There your routine can ask user for help, rectify things and retry or just return.
OR you can write simply throw; and catch one level higher.
The idea is not to brach on some magic numbers, but on the type of the exception object thrown - you can have a whole battery of catch-handlers after one try, and if you oder them from derived to base, you can fine tune what you catch.
try
{
..
}
catch (const std::myFunny_error& e)
{
..
}
catch (const std::runtime_error& e)
{
..
}
catch (const std::exception& e)
{
..
}
catch (...)
{
}



My opinions may have changed, but not the fact that I am right.
GeneralRe: Rephrasing the question Pin
Gary R. Wheeler21-Feb-03 11:22
Gary R. Wheeler21-Feb-03 11:22 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Chris Losinger20-Feb-03 12:06
professionalChris Losinger20-Feb-03 12:06 
GeneralRe: "Try" to "Catch" without "Throw" Pin
markkuk20-Feb-03 12:32
markkuk20-Feb-03 12:32 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Anton A. Loukine20-Feb-03 12:44
Anton A. Loukine20-Feb-03 12:44 
GeneralRe: "Try" to "Catch" without "Throw" Pin
jhwurmbach20-Feb-03 21:00
jhwurmbach20-Feb-03 21:00 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Anonymous21-Feb-03 3:19
Anonymous21-Feb-03 3:19 
GeneralRe: "Try" to "Catch" without "Throw" Pin
jhwurmbach21-Feb-03 3:49
jhwurmbach21-Feb-03 3:49 
GeneralRe: "Try" to "Catch" without "Throw" Pin
Christian Graus20-Feb-03 16:08
protectorChristian Graus20-Feb-03 16:08 
GeneralCopy opened files (read protected files) Pin
JGranborg20-Feb-03 11:37
JGranborg20-Feb-03 11:37 
GeneralCannot run MFC-compiled application on Win98se Pin
Valera24117620-Feb-03 11:21
Valera24117620-Feb-03 11:21 
GeneralRe: Cannot run MFC-compiled application on Win98se Pin
PJ Arends20-Feb-03 11:45
professionalPJ Arends20-Feb-03 11:45 
GeneralRe: Cannot run MFC-compiled application on Win98se Pin
Anonymous20-Feb-03 13:37
Anonymous20-Feb-03 13:37 
GeneralCString Array and Inserting Elements Pin
John W Hagen20-Feb-03 11:17
John W Hagen20-Feb-03 11:17 
GeneralRe: CString Array and Inserting Elements Pin
User 665820-Feb-03 11:29
User 665820-Feb-03 11:29 
GeneralRe: CString Array and Inserting Elements Pin
John W Hagen20-Feb-03 14:00
John W Hagen20-Feb-03 14:00 
GeneralCapturing 'Enter' key Pin
Toni7820-Feb-03 10:49
Toni7820-Feb-03 10:49 
GeneralRe: Capturing 'Enter' key Pin
Joaquín M López Muñoz20-Feb-03 11:30
Joaquín M López Muñoz20-Feb-03 11:30 

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.