DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: BUG: Save location remains in use  (Read 5,736 times)

dbareis

  • Participant
  • Joined in 2009
  • *
  • Posts: 28
BUG: Save location remains in use
« on: August 21, 2011, 10:42 PM »
Hi,

If I capture an image as use File->Save copy of image as" then later try to move or delete the directory this will fail, for some strange reason the program either changes its current directory to the destination (in which case it should restore it) or keeps the directory open.  Need to restart the program to be able to continue.

This has happened in older versions as well but currently I'm using v2.93.01

>:(

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: BUG: Save location remains in use
« Reply #1 on: August 21, 2011, 10:47 PM »
strange.  ill try to fix.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: BUG: Save location remains in use
« Reply #2 on: August 21, 2011, 10:53 PM »
This is pretty normal behavior - when you use the Get{Open,Save}FileName functions, Windows changes the process' (yes, it's per-process and not per-thread!) current working directory, and you have to actively save/restore the CWD if you don't want that behavior.

Keep in mind that OFN_NOCHANGEDIR "is ineffective for GetOpenFileName", so you might want to do manual CWD save/restore even though that flag exists. I seem to recall OFN_NOCHANGEDIR not working on some (ancient by now :)) Windows versions, but might just have confused that with not having effect for GOFN.
- carpe noctem

dbareis

  • Participant
  • Joined in 2009
  • *
  • Posts: 28
Re: BUG: Save location remains in use
« Reply #3 on: August 21, 2011, 11:45 PM »
Windows is just one big bag of bugs, the issue that prompted my post was on WINXP SP3 but pretty sure it also occurs at home on WIN7 64 bit.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: BUG: Save location remains in use
« Reply #4 on: August 21, 2011, 11:47 PM »
thanks for that info f0dder, that helps.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: BUG: Save location remains in use
« Reply #5 on: September 05, 2011, 06:34 PM »
fixed in beta version, will be in next release.

Original address: https://www.donationcoder.com/forum/index.php?topic=27705.0