Common Dialog does not release handle to folder

Hi,

I use the common dialog to get a file and i open the file
for reading. Once these two things are done and my
application is still running, if i try to delete the
file, it is ok, but if i try to delete the folder in
which the file resides, then the OS says, "...It is being
used by another person or program."

Any thoughts?

Thanks,

Jimmy
swabeuiAsked:
Who is Participating?
 
AlexFMConnect With a Mentor Commented:
Oops, this is VB area. I would write: SetCurrentDirectory API:

Public Declare Function SetCurrentDirectory Lib "kernel32" Alias "SetCurrentDirectoryA" (ByVal lpPathName As String) As Long
0
 
kevin_verpCommented:
Do you close the file properly, before trying to delete it?
0
 
kevin_verpCommented:
Can you post some of your code here so we can look @ it ?
0
 
AlexFMCommented:
Try to call
SetCurrentDirectory("some other directory");
before deleting of file.
0
All Courses

From novice to tech pro — start learning today.