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

大城市里の小女人 提交于 2020-12-03 14:26:10

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!