Hi all,
Any of you have an idea on how to change the "save as type: " from "*.*" to any other format such as "*.bmp" under the "file" menu in MFC of a SDI.
Tks
Printable View
Hi all,
Any of you have an idea on how to change the "save as type: " from "*.*" to any other format such as "*.bmp" under the "file" menu in MFC of a SDI.
Tks
no idea with MFC, but using straight Win32:
Code:bool saveDialog(char * buffer, unsigned buffsiz, const char * filters = NULL) {
OPENFILENAME ofn;
if(filters == NULL) {
filters = "All File Types\0*\0\0";
}
buffer[0] = 0;
memset(&ofn, 0, sizeof(ofn));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = GetFocus();
ofn.lpstrFilter = filters;
ofn.lpstrFile = buffer;
ofn.nMaxFile = buffsiz;
ofn.Flags = OFN_OVERWRITEPROMPT
| OFN_PATHMUSTEXIST
| OFN_HIDEREADONLY;
return GetSaveFileName(&ofn);
}
Set it in the contructor as in
Code:"Chart Files (*.xlc)|*.xlc|Worksheet Files (*.xls)|*.xls|Data Files (*.xlc;*.xls)|*.xlc; *.xls|All Files (*.*)|*.*||";