Re: Another basic question
- From: "Karl E. Peterson" <karl@xxxxxxxx>
- Date: Mon, 19 Mar 2007 13:35:38 -0700
Michael C <nospam@xxxxxxxxxx> wrote:
"Karl E. Peterson" <karl@xxxxxxxx> wrote ...
I think I've used Debug.Print CloseHandle (or DestoryWindow or similar) in
a few cases, to diagnose oddities, but I've certainly never found the need
to worry about passing 0 to that function. That's pretty harmless in the
grand scheme of things.
You missed the point though. Quite often we get straight VB code and VB code
using APIs that work very differently. Many developers don't check the
return codes from APIs and if there is a fault they ignore it. The results
in one lot of code that raises errors and another lot that ignores errors.
I'm sure some VB code will ignore errors closing handles so in this case it
might be ok to ignore the error but it's a *very* good idea to at least use
a debug.assert on it. If that is being done it's a good idea to check if the
handle is zero beforehand in case it gives an invalid handle error.
In general, yeah, I agree. In *this* specific case -- CloseHandle -- I've yet to
see it matter. YMMV.
--
..NET: It's About Trust!
http://vfred.mvps.org
.
- Follow-Ups:
- Re: Another basic question
- From: Michael C
- Re: Another basic question
- References:
- Another basic question
- From: Jack
- Re: Another basic question
- From: Karl E. Peterson
- Re: Another basic question
- From: Michael C
- Re: Another basic question
- From: Karl E. Peterson
- Re: Another basic question
- From: Michael C
- Another basic question
- Prev by Date: Re: Any WARNINGS? VB6 and VB.net on SAME COMPUTER???
- Next by Date: Re: Setting ComboBox Height [Solved!?]
- Previous by thread: Re: Another basic question
- Next by thread: Re: Another basic question
- Index(es):
Relevant Pages
|