开发者

Setting filters in the Open File dialog box with a wild card(*) in the middle in C

开发者 https://www.devze.com 2023-04-04 22:40 出处:网络
I\'m trying to set up a filter for the OpenFile dialog box which has both the prefix and file type already preset, with the wild card in the middle. (Using VS08, cpp)

I'm trying to set up a filter for the OpenFile dialog box which has both the prefix and file type already preset, with the wild card in the middle. (Using VS08, cpp)

FileFilter.Format("Prefix_(*.gdd)|Prefix_*.gdd|Any GDD File|*.gdd|all files|*.*|");

FileDialog = new CFileDialog(...);

The problem is that the Prefix_*.gdd filter isn't showing any files even though there is one present.

The filter works for an Explorer search - sho开发者_如何学运维uld it work here?


I found the mistake. The 'Prefix_' string, which was programatically generated, had the classic confusion between date and data, so the data files with date in their file names weren't found, leaving the OpenFile dialog empty.

It now appears to work properly.

0

精彩评论

暂无评论...
验证码 换一张
取 消