Click here to Skip to main content
16,017,261 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalurgent help Pin
Usman Tasleem Akshaf31-May-05 5:01
Usman Tasleem Akshaf31-May-05 5:01 
GeneralRe: urgent help Pin
Christian Graus31-May-05 11:48
protectorChristian Graus31-May-05 11:48 
GeneralGet & Setting only resource DLL Pin
Kaworu231-May-05 4:57
Kaworu231-May-05 4:57 
GeneralRe: Get & Setting only resource DLL Pin
Blake Miller31-May-05 5:53
Blake Miller31-May-05 5:53 
GeneralRe: Get & Setting only resource DLL Pin
Kaworu231-May-05 20:10
Kaworu231-May-05 20:10 
GeneralMFC and exception handling Pin
Cedric Moonen31-May-05 4:49
Cedric Moonen31-May-05 4:49 
GeneralRe: MFC and exception handling Pin
toxcct31-May-05 5:01
toxcct31-May-05 5:01 
GeneralRe: MFC and exception handling Pin
Cedric Moonen31-May-05 5:34
Cedric Moonen31-May-05 5:34 
Hi tox !

toxcct wrote:
lower lower level ???

-> InitInstance()...

otherwise, In the main frame constructor.


Nope, none of them is good because InitInstance is left when the window is created (it is not like in a dialog based application). What I want is a way to 'encapsulate' the message loop inside my try/catch block so I can really catch ALL exception (these are my own exceptions...) that can be thrown wherever in my code.


toxcct wrote:
but it is not so good to manage all the exception at only one place. you should have some try/catch at several places and maybe re-throw some of them if you like lower levels to cath'em and manage their part of the exception.

No, I know but here I want to have some try/catch block in my code to handle some exceptions. But I have also a lot of exceptions that can be thrown when resources are missing (these are external files). This would be really a lot of try/catch statements to put in my code (and this will be very ugly also).
In fact when a resource is missing, I just need to display a MessageBox with the error and quit the program. Thus, it's a little bit stupid to write try/catch statements everywhere in my code (and they are numerous !).

But thanks for your suggestion Smile | :)
GeneralRe: MFC and exception handling Pin
Jack Puppy31-May-05 8:52
Jack Puppy31-May-05 8:52 
GeneralRe: MFC and exception handling Pin
Cedric Moonen31-May-05 20:03
Cedric Moonen31-May-05 20:03 
GeneralRe: MFC and exception handling Pin
Bob Stanneveld31-May-05 10:37
Bob Stanneveld31-May-05 10:37 
GeneralPower Management Pin
Momotte31-May-05 4:28
Momotte31-May-05 4:28 
GeneralRe: Power Management Pin
Toby Opferman31-May-05 14:36
Toby Opferman31-May-05 14:36 
GeneralRe: Power Management Pin
geo_m31-May-05 19:44
geo_m31-May-05 19:44 
GeneralRe: Power Management Pin
Momotte1-Jun-05 1:04
Momotte1-Jun-05 1:04 
GeneralRe: Power Management Pin
geo_m1-Jun-05 1:24
geo_m1-Jun-05 1:24 
GeneralRe: Power Management Pin
Momotte1-Jun-05 6:07
Momotte1-Jun-05 6:07 
GeneralRe: Power Management Pin
geo_m1-Jun-05 8:33
geo_m1-Jun-05 8:33 
Generalstarting application.... Pin
Deian31-May-05 3:43
Deian31-May-05 3:43 
GeneralRe: starting application.... Pin
toxcct31-May-05 3:50
toxcct31-May-05 3:50 
GeneralRe: starting application.... Pin
Deian31-May-05 3:52
Deian31-May-05 3:52 
GeneralRe: starting application.... Pin
David Crow1-Jun-05 2:34
David Crow1-Jun-05 2:34 
GeneralRe: starting application.... Pin
Deian1-Jun-05 20:16
Deian1-Jun-05 20:16 
GeneralReplace bits within UInt32 Pin
zuschauer198031-May-05 3:22
zuschauer198031-May-05 3:22 
GeneralRe: Replace bits within UInt32 Pin
Ryan Binns31-May-05 3:28
Ryan Binns31-May-05 3:28 

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.