CFileDialog dlg(TRUE,"","*.*")中的*.*是啥意思啊

解决方案 »

  1.   

    *.*是文件的类型,*.*表示所有类型,*.txt*是文本类型的
      

  2.   

        同意楼上的说法,这表示筛选的文件类型,*.txt表示只显示文本文件和文件夹
      

  3.   

    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来自MSDN的权威解释,呵呵。
      

  4.   

    The lpszFilter parameter is used to determine the type of filename a file must have to be displayed in the file list box. The first string in the string pair describes the filter; the second string indicates the file extension to use. Multiple extensions may be specified using ‘;’ as the delimiter. The string ends with two ‘|’ characters, followed by a NULL character. You can also use a CString object for this parameter.For example, Microsoft Excel permits users to open files with extensions .XLC (chart) or .XLS (worksheet), among others. The filter for Excel could be written as:static char BASED_CODE szFilter[] = "Chart Files (*.xlc)|*.xlc|Worksheet Files (*.xls)|*.xls|Data Files (*.xlc;*.xls)|*.xlc; *.xls|All Files (*.*)|*.*||";算了,贴上完整的吧!FYI