Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set default file name extension in CMFCEditBrowseCtrl::EnableFileBrowseButton?

Tags:

visual-c++

mfc

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?

like image 458
Kumar Avatar asked Feb 12 '23 10:02

Kumar


1 Answers

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 |.

like image 65
Roger Rowland Avatar answered May 02 '23 13:05

Roger Rowland