I'm writing a program and I need to store some data in a binary file. I want to create this file in the same folder where the program is being run. The problem is that I need to store some paths to files chosen by the user. When the opendialog to choose these files is executed and you choose a file, the configuration file I want to use is created in the same folder where the file chosen in the opendialog is located, but not in the folder that contains the program. So it creates a new file instead of use the existing one in the program folder.
How can I tell the program that it musts write the file in the same folder where it's located?