这样干:static char BASED_CODE szFilter[]={"bmp files (*.bmp)|*.bmp|All files (*.*)|*.*||"};
CFileDialog dlg(TRUE,"BMP",NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,szFilter);
if(dlg.DoModal()==IDOK)
{
CString fPathname=dlg.GetPathName();
m_pPathname=fPathname;
}
CFileDialog dlg(TRUE,"BMP",NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,szFilter);
if(dlg.DoModal()==IDOK)
{
CString fPathname=dlg.GetPathName();
m_pPathname=fPathname;
}
解决方案 »
- 关于在动态库的导出函数里创建界面线程的问题
- 对话框中Onpaint 函数两次调用自己写的画图函数,为什么第二次没有显示
- 请教:一个关于定时发送短消息的程序设计思路(在线)
- CLISTBOX,自动往下滚动怎么实现,先谢谢了
- 请问如何得到Windows系统的版本
- 又要找工作了,各位在北京的兄弟可否推荐一下?
- 一个菜鸟问题,操作的时候总说记录集只读,如何解决?我的数据库连接是用向导生成的。
- 我的程序的realase不能用了:(
- 有谁做过计算单位面积图像颗粒多少、平均半径?参与讨论者有分
- 谁能介绍一本比较好的学习使用VC++的书!最好是网上免费的
- 请问哪儿有VS.NET7 Beta2的下载?谢谢
- COM实现实,要从所在的DLL中导出几个函数如DllGetClassObject,可是我导不出
openfile.m_ofn.lpstrFile=fname;
openfile.m_ofn.nMaxFile=500;
openfile.m_ofn.lpstrFilter="*.txt\0*.txt\0*.*\0*.*\0\0";
openfile.m_ofn.Flags=OFN_ENABLEHOOK|OFN_ALLOWMULTISELECT; // 这样就行了
^^^^^^^^^^^^^^
自己看看帮助吧!
DWORD MAXFILE = 2562; //2562 is the max
fd.m_ofn.nMaxFile = MAXFILE;
char pc[2562];
fd.m_ofn.lpstrFile = pc;
fd.m_ofn.lpstrFile[0] = NULL;
if(fd.DoModal()==IDOK)
{
POSITION pos = fd.GetStartPosition();
while (pos != NULL)
{
CString strFilePath=fd.GetNextPathName(pos);
............... }
}
Specifies that the File Name list box allows multiple selections. If you also set the OFN_EXPLORER flag, the dialog box uses the Explorer-style user interface; otherwise, it uses the old-style user interface.
If the user selects more than one file, the lpstrFile buffer returns the path to the current directory followed by the filenames of the selected files. The nFileOffset member is the offset, in bytes or characters, to the first filename, and the nFileExtension member is not used. For Explorer-style dialog boxes, the directory and filename strings are NULL separated, with an extra NULL character after the last filename. This format enables the Explorer-style dialogs to return long filenames that include spaces. For old-style dialog boxes, the directory and filename strings are separated by spaces and the function uses short filenames for filenames with spaces. You can use theFindFirstFile function to convert between long and short filenames. If you specify a custom template for an old-style dialog box, the definition of the File Name list box must contain the LBS_EXTENDEDSEL value.
OFN_ENABLEHOOK
Enables the hook function specified in the lpfnHook member 怎么会没有呢?