🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14878

Re: is this HANDLE valid ?

#14878
From: Remy Lebeau (TeamB)
Date: Tue, 29 Jul 2003 16:37
19 lines
1637 bytes
"PaoloItaly" <paolo@sirius.tecnoparco.it> wrote in message
news:3f26831b$1@newsgroups.borland.com...
> How is possible to understand if an HANDLE (file)
> is valid before to use it ?

You don't, short of simply performing a file operation on the handle and
testing for any errors.

> I can't check INVALID_HANDLE_VALUE, because
> the handle can have a normal value but just close, so the
> handle is no more valid

You should always set your handle back to INVALID_HANDLE_VALUE after you
close the file, for exactly that reason.  Once the file is closed, you can
test the handle for INVALID_HANDLE_VALUE later on.


Gambit
Technical Details
Message-ID: <3f26a159$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f26831b$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,a6eeeeef67823f86
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-29 09:40:55 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f26831b$1@newsgroups.borland.com>
Subject: Re: is this HANDLE valid ?
Date: Tue, 29 Jul 2003 09:37:10 -0700
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3f26a159$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1059496281 207.175.226.26 (29 Jul 2003 09:31:21 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail