Windows Vista and FileChooser

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?

Thanks,

Matt

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.

Hi Jules,

I have a really top tip. :slight_smile:

Install the free Microsoft Virtual PC 2007 on your Windows XP box.

http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx

And install your copy of Vista as a virtual machine within that.

This is how I do my Vista checking. Means that you won’t lay waste to your current Windows XP (or 2000) installation. :slight_smile:

As an alternative, you could use Parallels on your Mac (another great product).

HTH!

Pete