Kumar
Kumar

Reputation: 626

how to set default file name extension in 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");

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?

Upvotes: 4

Views: 2550

Answers (1)

Roger Rowland
Roger Rowland

Reputation: 26259

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

Upvotes: 8

Related Questions