我重载了文件保存时的命令,更改了文件过滤器。现在发现在保存的时候如果在保存文件名里面写“out”,再在扩展名下拉列表里面选“.txt” 保存出来的是“out” 而不是“out.txt” 囧,怎么获得这个下拉列表里面的值呢@@
bow~~
bow~~
解决方案 »
- 用ToolStripItemCollection.Add 添加一个菜单,这个不知该怎么写
- 用 VS 2008 能运行我的EXE,但单独运行点击EXE就运行不了
- 求考勤系统
- ADO 访问数据库,总说不能在分布或手工下处理事务的错误
- 高手请教!为什么在MSDN中查不到ADO之rs之GetCollect()的函数,如何获得次函数的说明?
- 走出MFC子类化的迷宫 ---原创中的疑惑,在线等待
- 请问高手一个问题?(急,在线等待)
- 文件比较
- 如何给对话框和文档的用户区加上一个背景(如一个图片)?
- need some training on software engeering
- 程序结束时显示内存泄露
- 请问怎么在win32下用gdi+实现双缓存?
[Quote]
Override this function only if you want to provide custom validation of filenames that are entered into a common file dialog box.
virtual BOOL OnFileNameOK( );
Return Value
1 if the filename is not a valid filename; otherwise 0.Res
This function allows you to reject a filename for any application-specific reason. Normally, you do not need to use this function because the framework provides default validation of filenames and displays a message box if an invalid filename is entered. If 1 is returned, the dialog box will remain displayed for the user to enter another filename. The dialog procedure dismisses the dialog if the return is 0. Other nonzero return values are currently reserved and should not be used.[Quote]
virtual void OnLBSelChangedNotify( UINT nIDBox, UINT iCurSel, UINT nCode);可是这个函数要UINT nIDBox 即 后缀名列表的ID,这个ID该怎么才能获得呢@@
得到。
Open Button
1
Cancel Button
2
file name(Edit Combo)
1152
folder(Combo)
1137
read only(Label)
1040
file extension(Combo)
1136
FolderView(ListView)
1
ToolBar
1088
未经证实!
CFileDialog oFileDlg(FALSE, .... );
然后判断这个变量就可以了:
sel = oFileDlg.m_ofn.nFilterIndex;O(∩_∩)O