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

From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 08/25/04


Date: Wed, 25 Aug 2004 18:27:43 -0400

I make it a design primciple that there is never, ever, anywhere in my code, the
possibility of getting the same message issued from two different places. Each site makes
sure it uniquely identifies itself, so if an issue is reported by a customer, the exact
line in the source code that issues the error can be identified. Often, as you point out,
it is simply an ID of some sort. For user-related errors, it is some word or phrase that
would convey meaning to the user; for internal errors, it is sometimes an error code,
sometimes a file/line, but it is always unique.

One of the things that is after all the years C and C++ has been around, there has never
been a compiler intrinsic current_function which is a string that is the name of the
function.
                                joe

On Wed, 25 Aug 2004 11:08:42 -0500, "Doug Harrison [MVP]" <dsh@mvps.org> wrote:

>Udo Huebner wrote:
>
>>Nevertheless, the search for the reason of the warning is
>>tedious in this bigger program. Is there any reasonable
>>methodical way?
>
>Not that I know of. I always just search the source code. It's useful to add
>a cookie such as the function name to each such message, so you can
>distinguish messages which otherwise are duplicates. You can't do that for
>MFC, but for your own code... On a related note, one of the worst things you
>can do is throw an exception from many places and not tag it with more
>context than the generic message string, which might be "Resource was not
>available". Functions like AfxThrowResourceException(void) should be
>avoided. In general, you'd be better off if they were defined as macros that
>included the function name in the message with the __FUNCTION__ macro.

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm



Relevant Pages

  • Re: Restart Window Service
    ... (And the code shown is incorrect no matter what the goal is). ... There is no reason to use a wait hint other than 0 if the type is not a _PENDING type ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: You are a f*****t. A moronic, clueless, cretinous, imbecilic, idiotic,
    ... this is one MVP who certainly *will not* stick up for her. ... >to come alive.For some reason some of the regulars in this group (the xp ... >groups) and a few of the MVP's stick up for her, maybe because she is nasty ... >> 3) Your 'advice', as well as being dangerous, is so poorly written ...
    (microsoft.public.windowsxp.newusers)
  • Re: Downloading files
    ... for no better reason than having its ... source code, is a truly _excellent_ way to fool yourself and shoot ... newsgroup that only posts code for lovers of viri. ... (setq (chuck nil) ...
    (comp.os.linux.setup)
  • Re: packagemaker script assistance needed.
    ... Santa Claus wrote: ... Is there a reason you're conditionalizing the whole block instead of one ... the reason my program source code is so long. ...
    (comp.sys.mac.programmer.help)
  • Re: Listbox selected line mostly just below bottom of window
    ... It's on my MVP Tips site. ... While a global handle variable is extremely poor style, it is not the reason for the ... and the RedrawWindow is completely irrelevant to the solution of the problem; ... not surprised to learn the programming methods aren't great. ...
    (microsoft.public.vc.mfc)