CfileDialog不能依据选择的filter类型自动推导扩展名
来源:互联网 发布:运营数据分析 数据挖掘 编辑:程序博客网 时间:2024/06/06 00:48
在使用CfileDialog发现CfileDialog不能依据选择的filter类型自动推导扩展名,总感觉这是一个缺陷。因为已经使用选择的filter进行文件类型筛选了。代码如下:
CString str("PDF Files (*.pdf)|*.pdf|PDF Edit Files (*.prj)|*.prj||");
CFileDialog dlg(FALSE, NULL, pDoc->getDocumentFileName(),
使用dlg.GetFileExt()返回扩展名为空。
查询MSDN叙述如下:
lpszDefExt
The default filename extension. If the user does not include an extension in the Filename edit box, the extension specified by lpszDefExt is automatically appended to the filename. If this parameter is NULL, no file extension is appended.
但是也没有说明依据选择的filter添加扩展名。只是说明自动添加lpszDefExt。使用如下代码后dlg.GetFileExt()工作正常。
CString str("PDF Files (*.pdf)|*.pdf|PDF Edit Files (*.prj)|*.prj||");
CFileDialog dlg(FALSE, “.Pdf”, pDoc->getDocumentFileName(),
- CfileDialog不能依据选择的filter类型自动推导扩展名
- go语言自动推导类型不能放在函数外
- 模板函数的参数类型不能通过表达式推导
- kotlin Android中 findViewById()不能推导类型的错误
- 模板以及类型自动推导
- larva的类型推导
- 关于图片上传方案选择的依据
- EXTJs和JQuery的技术选择依据
- 类模板为什么不能自动推导数据类型
- CFileDialog文件选择对话框的使用
- CFileDialog文件选择对话框的使用
- CFileDialog文件选择对话框的使用
- 文件选择对话框的使用(CFileDialog)
- CFileDialog文件选择对话框的使用
- CFileDialog文件选择对话框的使用
- MFC文件选择对话框CFileDialog的使用
- 如何通过CFileDialog进行路径的选择
- CFileDialog文件选择对话框的使用
- 布匹破损检测与自动缝补系统(佛山海天调味品有限公司)
- CreateProcess函数使用
- IT问题日记1
- 分布式随笔1-分布式概述
- SublimeText比较文件插件Diffy用法
- CfileDialog不能依据选择的filter类型自动推导扩展名
- dispatch_group项目中使用
- oracle默认初始化用户名密码和密码修改
- STM32 串口中的硬件BUG,请注意!
- 9月的天气很好,bug很少
- 半小时学会上传本地项目到github 及 github提交报错failed to add file / to index解决办法
- php中关于==和===的理解和认识
- Android Path的使用详解
- Maven类包冲突终极三大解决技巧 mvn dependency:tree