Re: Message unknown: "Warning: initial dialog data is out of range."

From: Martin Aupperle (XXXMartin.Aupperle_at_PrimaProgrammXXX.de)
Date: 08/30/04


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
------------------------------------------------



Relevant Pages

  • Re: C++ in embedded systems
    ... linker and compiler work together flawlessly, ... when it has absolutely no idea what kind of exception handling ... programmer would imagine that the two calls to foowould take ... Providing an object constructor with a single parameter type may ...
    (comp.os.linux.embedded)
  • Re: Reprise: in out parameters for functions
    ... one could have entries of multiple protected objects and tasks. ... > compiler checked your units for you, ... > You assumed that the root type for Exception would be tagged record. ... > package Crazy is ...
    (comp.lang.ada)
  • Re: initial lang spec: SXIL...
    ... implementation of most Lisp's, and also that most serious Lisp ... on a Lisp style core (very possibly, one could get by making the compiler ... the big hairy issue though is just how to handle exception handling... ... being only a single exception handler per function). ...
    (comp.lang.misc)
  • Re: Is it a BUG in C# compiler ?!!!!
    ... more than that will generate the said exception. ... > InitializeComponent method to empty text file gives us 23.100 lines and size ... > Is it a BUG in C# compiler? ...
    (microsoft.public.dotnet.framework)
  • Re: Exceptions take too long
    ... What is the exact compiler version, and what are the command line flags ... Rewritten w/out exception, ... ULONG getError ... virtual BOOL Unlock ...
    (microsoft.public.windowsce.embedded.vc)