Re: New HIDE (HLA IDE) version is available

From: f0dder (f0dder_spicedham_at_flork.dk)
Date: 08/25/04


Date: Wed, 25 Aug 2004 16:42:49 +0200

The Wannabee wrote:

> I no longer remember where I read this, and it might be I am
> mistaken, but the reason, I think, was that in some rare cases the
> getmessage function return 0 to indicate failure (BUG). And sometimes
> return a non null error code. But anyway, I never actually had any
> problems that I know of either way. If you test for less then 1, or 0
> its is possible that the code could run into the few (buggy) states
> that return 0 = &FALSE to indicate failure. However, this is at least
> 5 years old info.
>
I'm afraid you didn't understand what I wrote :)

See, right now you're considering that a return-value of 1 is success,
keep on going, while everything else is an error. It's okay to treat
"0 and everything less than zero" as a reason to quit your program
(0 means WM_QUIT, less than zero means error).

However, your "success is equal to 1" would also abort on return
values *larger* than 1 - which is not good. Consider that in C/C++
0 is false and everything else is true. Windows is written mostly in
C, with a little C++ and assembly. Thus nothing stops parts of
windows from returning "5" to indicate success, if it feels like it...

So, better to use a (*signed*!) less-than-1 to be bulletproof.

> And I have never ran into this problem.
>
And there's a good chance you never will. But do you remember what
happened with dirty written apps that didn't return a proper value
from their dlgprocs? Worked fine on 9x in most cases, screwed up
on NT in most cases.

> Unless I am totally mistaken, I read this info, in MSDN
> Knowledgebase, while going off on one of my Win32.hlp file
> adventures using the <--- ---> page keys :-)))
Hehe, go get the PlatformSDK already ;)



Relevant Pages

  • Re: 2-year-olds reading?
    ... There is no reason to prevent them. ... reason to inflict reading lessons on little kids who would rather be doing ... What criteria were used to measure success in whatever study it is ... positive correlation between income and happiness, ...
    (misc.kids)
  • Re: BizTalk 2004 :: WSE attachment nightmare
    ... No success, but an update: ... I googled the error code and only got a single result: ... I cannot find any relevant information why this orchestration is terminating ... > code/orchestration/configuration but cant find a problem. ...
    (microsoft.public.biztalk.general)
  • Re: [PATCH 1/1] mfd: twl4030: clarify the return value for read and write
    ... Please consider fixed patch instead. ... How about reporting the actual error that has occurred and reported by i2c_transfer? ... But if returns and error code, then that error code must be reported to upper layers. ... Currently we return success even if none of messages were transferred ...
    (Linux-Kernel)
  • Re: test sory
    ... The actual post was a success, the destination group was the failure. ... have a successful post to a test group but several posts failed to show up ... try and explain the reason for test groups existing. ...
    (alt.os.linux.suse)