In an app I am working on, I've found that if I run GetOpenFileName and select a file by double-clicking, then later, if I save some settings to my ini file using WritePrivateProfileStruct or String, everything seems to work ok, but the next time I run the program, the ini values are back to their old settings.  If I immediately do a GetPrivateProfile* after the write, the values come back with the correct values, but are still incorrect the next time I run the program.  I have repeatedly tested this.  If I don't execute the GetOpenFileName and double click a file, the ini settings work properly.  It seems that GetOpenFileName is wiping out the cache for the ini writes when I exit the program.  Is there some way to get around this problem?
Posted on 2005-12-11 11:26:32 by JimG
Let me guess, you specify a relative path for the .ini file name? GetOpenFileName changes Current Working Directory, so you probably have a couple of .ini files at various locations on your harddisk now :)
Posted on 2005-12-11 12:06:42 by f0dder
Good guess!  Next time I'll ask before wasting two days screwing around.  Thanks :P
Posted on 2005-12-11 14:50:48 by JimG