展开全部
CFileDialog( BOOL bOpenFileDialog, LPCTSTR lpszDefExt = NULL, LPCTSTR lpszFileName = NULL, DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, LPCTSTR lpszFilter = NULL, CWnd* pParentWnd = NULL );
Parameters
bOpenFileDialog
Set to TRUE to construct a File Open dialog box or FALSE to construct a File Save As dialog box.//true是打开文件对话框。false是保存对话框。
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.//文件名的默认后缀。
lpszFileName
The initial filename that appears in the filename edit box. If NULL, no filename initially appears.//默认选择的文件。没有的话,就设空。
dwFlags
A 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.//标记。具体查阅MSDN
lpszFilter
A 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 Remarks section for more information on how to work with file filters.//过滤字串。就是设定文件类型用的。比如说你要打开图片。那么你可以设定.bmp,.jpg。当然格式还是要查一下。MSDN上有例子。
pParentWnd
A pointer to the file dialog-box object’s parent or owner window.//父窗口。
用户点确定之后,你可以用这个cfiledialog的对象的成员函数getfilename来获取用户选择的图片的路径。就是相当于知道要传哪个文件了。传送的部分是网络通信的问题了。不知道你有没研究过。
Parameters
bOpenFileDialog
Set to TRUE to construct a File Open dialog box or FALSE to construct a File Save As dialog box.//true是打开文件对话框。false是保存对话框。
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.//文件名的默认后缀。
lpszFileName
The initial filename that appears in the filename edit box. If NULL, no filename initially appears.//默认选择的文件。没有的话,就设空。
dwFlags
A 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.//标记。具体查阅MSDN
lpszFilter
A 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 Remarks section for more information on how to work with file filters.//过滤字串。就是设定文件类型用的。比如说你要打开图片。那么你可以设定.bmp,.jpg。当然格式还是要查一下。MSDN上有例子。
pParentWnd
A pointer to the file dialog-box object’s parent or owner window.//父窗口。
用户点确定之后,你可以用这个cfiledialog的对象的成员函数getfilename来获取用户选择的图片的路径。就是相当于知道要传哪个文件了。传送的部分是网络通信的问题了。不知道你有没研究过。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询