CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: SaveDialog bug

  1. #1
    Join Date
    Oct 2005
    Posts
    2

    Angry SaveDialog bug

    If you open a SaveDialog box and you save a file to path "C:\example\test.txt" for example, then you cannot rename or delete the folder "example" until you close the application. An error message appears and tells us that the folder is in use by another application.

    You can see the problem if you save a document in Word for example, with the Save As dialog. Then close the document without closing Word and try to rename the parent folder of this file. You Cannot!

    So, the SaveDialog box constrains the file. Do you know how we can free this file handle? I am using Borland C++ Builder 6.

    Helias

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: SaveDialog bug

    It is not a glitch. It is a standard in Windows. Certain applications will lock a file until the application is closed.

    I am not sure but I think that it might be a form of file locking.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Oct 2005
    Posts
    2

    Re: SaveDialog bug

    Yes, it's standard but it's silly. I am writing an MDI application and I need to open a file, then close it and then rename it and I can't do it. Is there any way to prevent this file locking?

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: SaveDialog bug

    Internal commands (of your programming language) of renaming a file should not be affected because it will be your program that has the file lock.

    What language are you writing in?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

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

Featured