Dateiname und -typ vorgeben
-
Hallo,
nach dem Aufruf des CFileDialog (true=false), um eine
Datei zu speichern, möchte ich gleich den Dateinamen und -typ vorgeben. Welche Lösung gibt es?
Vielen Dank für die Hilfe.
-
du gibst beim parameter lpszfilter einfach die dattypen an:
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 (.)|.||";
-
Oser man schaut einfach vorher in die FAQ