Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

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
0
swabeui
Asked:
swabeui
  • 2
  • 2
1 Solution
 
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
 
AlexFMCommented:
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now