Re: Message unknown: "Warning: initial dialog data is out of range."
From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 08/25/04
- Next message: Joseph M. Newcomer: "Re: How to close app and reopen it again"
- Previous message: Joseph M. Newcomer: "Re: how to iterate all controls of a CDialog"
- In reply to: Doug Harrison [MVP]: "Re: Message unknown: "Warning: initial dialog data is out of range.""
- Next in thread: Alexander Grigoriev: "Re: Message unknown: "Warning: initial dialog data is out of range.""
- Reply: Alexander Grigoriev: "Re: Message unknown: "Warning: initial dialog data is out of range.""
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Joseph M. Newcomer: "Re: How to close app and reopen it again"
- Previous message: Joseph M. Newcomer: "Re: how to iterate all controls of a CDialog"
- In reply to: Doug Harrison [MVP]: "Re: Message unknown: "Warning: initial dialog data is out of range.""
- Next in thread: Alexander Grigoriev: "Re: Message unknown: "Warning: initial dialog data is out of range.""
- Reply: Alexander Grigoriev: "Re: Message unknown: "Warning: initial dialog data is out of range.""
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|