Pelles C forum

C language => Beginner questions => Topic started by: PhilG57 on July 02, 2026, 04:16:44 PM

Title: Working Directory woes
Post by: PhilG57 on July 02, 2026, 04:16:44 PM
I have a Windows project with multiple versions kept in separate directories.  I edit and update in one directory and when those changes look and test good, I move them to another, separate, directory of more stable code.

In any of those project versions, when I open a file with GetOpenFileName(), the directory shown from which to select a file to open, is the directory last used by Pelles C.  For example, in the GetOpenFileName() dialog, if I change to a different directory and select a file from there, that directory becomes the 'default' location shown by GetOpenFileName() the next time it is called.

So far, so good I think.  What I don't understand is with the opening of a new or different project using the same instance of Pelles C, or especially with a new clean instance of Pelles C, why does the default GetOpenFileName() use what I selected before and not the default directory listed in my project's options. As part of the initialization code, I do execute a GetCurrentDirectory() followed by a SetCurrentDirectory() to no avail.

As always, thanks in advance.