Results 1 to 2 of 2

Thread: [RESOLVED]Sharing Violation after choosing file in CommonDialog

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2001
    Location
    Buffalo, NY
    Posts
    297

    [RESOLVED]Sharing Violation after choosing file in CommonDialog

    I have a common dialog control that I use to let the user choose a File.

    Once the user has double-clicked the file in the ShowOpen dialog (or clicked it and clicked 'Open'), the parent folder of that file is locked out.

    When I try to rename the folder I get the error message:

    There has been a Sharing Violation

    When I try to rename that folder's parent folder, I get the error message:

    Access Denied

    Further more, when the application stops running, these folders are still locked out! It isn't until the VB IDE shuts down that the folders are released again.

    I tried setting the CommonDialog.FileName = "" to release the folder, but that doesn't change anything. Also, I have set the flags = &H4000


    Any ideas?

    Thanks!

    --Ben
    Last edited by BenFinkel; Oct 30th, 2002 at 04:12 PM.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2001
    Location
    Buffalo, NY
    Posts
    297
    So I found it.

    Turns out the CommonDialog changes the current processess' Current Directory. I just had to call the SetCurrentDirectory API to change it back to something else to fix the problem.

    --Ben

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width