如何在 CMFCEditBrowseCtrl::EnableFileBrowseButton 中设置默认文件扩展名? [英] how to set default file name extension in CMFCEditBrowseCtrl::EnableFileBrowseButton?

查看:77
本文介绍了如何在 CMFCEditBrowseCtrl::EnableFileBrowseButton 中设置默认文件扩展名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 CMFCEditBrowseCtrl::EnableFileBrowseButton 中给出默认文件扩展名?应该如何传递参数?我试过像下面的代码.

how to give default file name extension in CMFCEditBrowseCtrl::EnableFileBrowseButton? How the arguments should be passed? I tried like following code.

CMFCEditBrowseCtrl py_file_path;
py_file_path.EnableFileBrowseButton(_T"PY",_T"*.py");

但它没有显示 .py 文件.它说没有项目匹配".我想我使用的 lpszDefExtlpszFilter 值存在一些问题.谁能告诉我列出所有 .py 文件的这些参数的价值是什么?

But it is not displaying the .py files. It says "no items matches". I guess there is some problem with the lpszDefExt and lpszFilter values i use. Could anyone tell me what is the value of those arguments to list all .py files?

推荐答案

你需要这样设置:

CMFCEditBrowseCtrl py_file_path;
py_file_path.EnableFileBrowseButton(_T("PY"), _T("Python files|*.py||"));

最后一个参数是一个过滤器字符串,其中描述和过滤器由 | 分隔.

The final argument is a filter string, where the description and filter are delimited by |.

这篇关于如何在 CMFCEditBrowseCtrl::EnableFileBrowseButton 中设置默认文件扩展名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆