can this be done

From: ed (ed_at_discussions.microsoft.com)
Date: 12/29/04


Date: Wed, 29 Dec 2004 14:39:01 -0800

I'd like to catch all possible exceptions in my application. It is a
relatively simply application with one CWnd object that takes care of all the
functionality in the application.

If I did something like the below in my CMyApp::InitInstance()
implementation would it catch all the exceptions that might occur within the
CWnd (called My_Main_CWnd).

BOOL CMyApp::InitInstance()
{
CWinApp::InitInstance();

TRY
{
// Create a CWnd object called My_Main_CWnd

m_pMainWnd = &My_Main_CWnd;

My_Main_CWnd.ShowWindow(SW_SHOW);
My_Main_CWnd.UpdateWindow();

m_pMainWnd->RunModalLoop(0);
}
CATCH_ALL(error)
{
//deal with the exception
}
END_CATCH_ALL;
}

return FALSE;
}



Relevant Pages

  • Re: Agent 3.0 Woof
    ... Record companies spend piles of money on producing 'monster' hits. ... few exceptions, the only way you can get monster hits is by selling a ... Classical enthusiasts care about this because slow-and-steady earners ...
    (rec.music.classical.recordings)
  • Re: which kind of Exceptions to throw?
    ... As far as the distinction between the two go, ... generally considered to be that NotSupportedExcpetion is used in derived ... classes where the functionality isn't built into the base class. ... I'd recommend using custom exceptions when you need finely grained ...
    (microsoft.public.dotnet.general)
  • Re: Pythonic API design: detailed errors when you usually dont care
    ... I have an API design question. ... Most of the time the code calling the function won't ... care about the reason for the failure, ... I think Python users are right to "default to" raising exceptions. ...
    (comp.lang.python)
  • Re: testing parent-child relations using only ids
    ... And exceptions are *necessary*: Without them, ... I don't care about the exceptions *themselves*; ... I was kidding a bit about the wonders of macros. ... should try to flame in their forum; I'll bet you'd get stomped on. ...
    (comp.lang.cpp)
  • Re: To wrap or not to wrap?
    ... Aaron Fude wrote: ... String MyIO.urlToString ... These functions catch exceptions and return null if something ... You should use the exception functionality as it is intended. ...
    (comp.lang.java.programmer)

Loading