初学vc++,我在程序里定义:CFileDialog myDialog;
却怎么也编译不过,出错信息为:
error C2512: 'CFileDialog' :no appropriate default constructor available Error executing cl.exe.
是什么原因,快快救命啊。
却怎么也编译不过,出错信息为:
error C2512: 'CFileDialog' :no appropriate default constructor available Error executing cl.exe.
是什么原因,快快救命啊。
解决方案 »
- mfc中新建了一个dialog资源,给这个dialog资源添加类的时候找不到ID
- OpenGL和OpenGL es的问题
- 基于对话框界面的控件在网页调用成功,但在对话框的程序调用该控件出现异常,请问在对话框程序如何调用一个基于对话框界面的控件
- 如何检测机器的串口?
- 大家帮帮忙,关于图形的,问题很麻烦,进来看详细信息!!!
- 问三个问题!请大虾们解决一下!
- 如何把check box 嵌入到list Control中???
- 怎样定制MessageBox的按钮
- MFC release库,是什么?
- 为什么在sqlserver上正常运行,在客户端就不行了?(ADO)
- 《深入浅出MFC》:候捷、候俊杰谁的更好!
- ****在线等待组合框的基础问题***************????
如果是打开对话框,那么用CFileDialog myDialog(true);
如果为保存对话框,用CFileDialog myDialog(false);
详细参数请见MSDN。
CFileDialog::CFileDialog
CFileDialog( BOOL bOpenFileDialog, LPCTSTR lpszDefExt = NULL, LPCTSTR lpszFileName = NULL, DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, LPCTSTR lpszFilter = NULL, CWnd* pParentWnd = NULL );ParametersbOpenFileDialogSet to TRUE to construct a File Open dialog box or FALSE to construct a File Save As dialog box.lpszDefExtThe 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.lpszFileNameThe initial filename that appears in the filename edit box. If NULL, no filename initially appears.dwFlagsA combination of one or more flags that allow you to customize the dialog box. For a description of these flags, see theOPENFILENAME structure in the Win32 SDK documentation. If you modify the m_ofn.Flags structure member, use a bitwise-OR operator in your changes to keep the default behavior intact.lpszFilterA series of string pairs that specify filters you can apply to the file. If you specify file filters, only selected files will appear in the Files list box. See the Res section for more information on how to work with file filters.pParentWndA pointer to the file dialog-box object’s parent or owner window.