问题
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");
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?
回答1:
You need to set it like this:
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 |
.
来源:https://stackoverflow.com/questions/24950588/how-to-set-default-file-name-extension-in-cmfceditbrowsectrlenablefilebrowsebu