Re: Releasing Dir() Search Handle
- From: "Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 3 Jul 2008 17:35:15 +0100
You cannot have a folder called nul Peter. nul is a special file name, just
like com1, etc
See http://msdn.microsoft.com/en-us/library/aa365247.aspx
Tony
"PeterD" <peter2@xxxxxxxxxx> wrote in message
news:n5pp64l3ktrnob8nk20lbf6fcr7pqkdp50@xxxxxxxxxx
On Wed, 2 Jul 2008 17:39:15 -0700, "Karl E. Peterson" <karl@xxxxxxxx>
wrote:
Hi Folks --
I just wanted to be sure about something, so I wrote up a little test...
Option Explicit
Private Sub Command1_Click()
Debug.Print Dir("c:\*.*")
End Sub
Private Sub Command2_Click()
Debug.Print Dir("nul")
End Sub
Compiling that, and watching it in TaskMgr, I see the Handle count rise
when I press
Command1 and drop when I press Command2. I've tried googling for this, to
no avail,
but I know I've seen threads here before about releasing the search handle
VB
creates by calling FindFirstFile on a Dir.
I did find posts suggesting that passing vbNullString would do it too, but
that
doesn't seem to be the case given the above test. Anyone have any
thoughts on this?
Thanks... Karl
In Dir("nul") you (probably) don't have a folder named "nul" so the
dir command completes, and frees its handle? I think you will find the
same is true when the Dir() is called (no parameter) sufficiently to
enumerate all the items in the given folder based on the first call
that creates the handle.
.
- References:
- Releasing Dir() Search Handle
- From: Karl E. Peterson
- Re: Releasing Dir() Search Handle
- From: PeterD
- Releasing Dir() Search Handle
- Prev by Date: Re: simple string encryption
- Next by Date: Re: insert an Excel graph into a Richtextbox?
- Previous by thread: Re: Releasing Dir() Search Handle
- Next by thread: Re: Releasing Dir() Search Handle
- Index(es):
Relevant Pages
|