I’m using FileChooser with the native dialog flag turned on. On Vista, calling browseForFileToOpen displays the correct dialog, but no files are displayed space even though there are files of the correct type in the folder.
I was able to get to work by modifying FileChooser::showPlatformDialog in the Win32-specific code (in the new 1.42 release). I added:
to the section of the code that initializes the OPENFILENAMEW struct.
In other words, the file type filter string gets copied to the filename before calling GetOpenFileName or GetSaveFileName.
I realize this may not be a good generic solution; does anyone else have any thoughts?
Hmm. Good old Vista. I’ve not been stupid enough to upgrade to it yet, so can’t try myself.
So are you now setting both of.lpstrFilter and of.lpstrFile to be the same filter string? That would mean that the last filename won’t be shown as the default value in the box…
[quote=“jules”]
So are you now setting both of.lpstrFilter and of.lpstrFile to be the same filter string? That would mean that the last filename won’t be shown as the default value in the box…[/quote]
I’m not 100% sure what you mean here; on Vista, if you set lpstrFile to a null string, the default value just comes up empty.
I’m not saying that my solution is the correct one; it’s just a hack I made to work around the problem.