views:

67

answers:

0

I have a feature where I save a file to a location that user specifies. I'm using GetSaveFileName() to show the Save As dialog. I then use the path that it returns to write out the file to that location. I've noticed that it does not work when the user chooses the CD-RW drive on an XP machine. This same process works correctly on Vista and Windows 7. I've made the following observations:

  1. The path returned by GetSaveFileName() returns the path of the temporary staging area when choosing the CD burner root folder (F: in my case) on Win7/Vista.
  2. On XP, choosing the CD burner root folder just returns F:\ as the path. HOWEVER, if I create a sub folder using the Save As dialog and save the file in this folder (e.g. F:\folder), the path is that of the temporary folder.
  3. Using another application such as Notepad in XP will correctly redirect to the temp folder for F:\ .

So the problem only exists when saving to the root folder of the CD burner on XP. How can I achieve the same functionality as Notepad in XP and have Save As redirect to the temp folder so I have have a path I can write to for CreateFile()?