Re: Message unknown: "Warning: initial dialog data is out of range."
From: Martin Aupperle (XXXMartin.Aupperle_at_PrimaProgrammXXX.de)
Date: 08/30/04
- Next message: Joseph M. Newcomer: "Re: Terminating program in ProcessWndProcException"
- Previous message: Tobias Güntner: "Re: CScrollView constructor"
- In reply to: Doug Harrison [MVP]: "Re: Message unknown: "Warning: initial dialog data is out of range.""
- Next in thread: Doug Harrison [MVP]: "Re: Message unknown: "Warning: initial dialog data is out of range.""
- Reply: Doug Harrison [MVP]: "Re: Message unknown: "Warning: initial dialog data is out of range.""
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 30 Aug 2004 20:03:30 GMT
On Fri, 27 Aug 2004 14:45:17 -0500, "Doug Harrison [MVP]"
<dsh@mvps.org> wrote:
>Doug Harrison [MVP] wrote:
>
[snip]
>but in
>straight C++, I don't know how to do any better than writing some function
>prologue/epilogue macros that catch well-known exception types, add
>information to the error messages, and rethrow the exception. It seems like
>the compiler could help some here, but AFAIK, it doesn't.
>
nearly. The problem here is that you need a try/catch/throw bracket
in every function. This uses MUCH resources and conflicts with user
defined try/catch/throw patterns, but what is worse, you need a macro
not only at the beginning but also at the *end* of every function.
This clutters the source, is ugly, can and will be forgotten by the
programmer and usualy is not exception safe.
Better solution is to have only one macro at the beginning of a
function, like
void f()
{
FSTART( "f" );
....
}
It defines a local object whose constructor pushes the function name
(and maybe other info) on a stack and the destructor pops it off. Now
if f throws, the stack trace is available.
Not really nice, but its easy, does not cost much
resources/performance, and does not impose anything on the exception
type. Can also be easily compiled out by defining FSTART to void(0)
Martin
------------------------------------------------
Martin Aupperle
------------------------------------------------
- Next message: Joseph M. Newcomer: "Re: Terminating program in ProcessWndProcException"
- Previous message: Tobias Güntner: "Re: CScrollView constructor"
- In reply to: Doug Harrison [MVP]: "Re: Message unknown: "Warning: initial dialog data is out of range.""
- Next in thread: Doug Harrison [MVP]: "Re: Message unknown: "Warning: initial dialog data is out of range.""
- Reply: Doug Harrison [MVP]: "Re: Message unknown: "Warning: initial dialog data is out of range.""
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|