Platform SDK

Query for the path every time you open a file

Because Windows provides a dynamic operating environment for your application, it is not always safe to make assumptions about the location of files or folders. Default storage locations may change during the runtime of your program. With this in mind, when opening files, always query the path beforehand to ensure it hasn't changed since the last time you used that file. To allow your program to handle this dynamic environment, we have compiled the following guidelines, which we discuss in more detail in subsequent sections.