c++.windows.32-bits - file extension when saving
- Steve & Denise De Chellis (27/27) Jul 31 2002 How do I set up the common save dialog to deal with multiple filters? I ...
- Jan Knepper (4/31) Jul 31 2002 See if you can used the attached files.
- Steve & Denise De Chellis (9/45) Jul 31 2002 Unfortunately for me I do not use classess much in this program. I was
- Jan Knepper (3/53) Jul 31 2002 Well, the class isn't that difficult to use...
How do I set up the common save dialog to deal with multiple filters? I want it to append the proper extension to the file when saving. I'm using this: BOOL GetFileNameSave(char *filename, int len, HWND hWnd) { OPENFILENAME ofn; ZeroMemory(&ofn, sizeof(OPENFILENAME)); //Zero out the memory for the filename info ofn.lStructSize = sizeof(OPENFILENAME); //Size of the structure ofn.hwndOwner = hWnd; //Window that is calling this if(nUID>=2000) { ofn.lpstrFilter = ("HackMaster Files (*.hmf)\0*.hmf\0HTM Files (*.htm)\0*.htm\0HTML Files (*.html)\0*.html\0"); //Filters } if(nUID<2000) { ofn.lpstrFilter = ("HTM Files (*.htm)\0*.htm\0HTML Files (*.html)\0*.html\0"); //Filters } ofn.lpstrFile = filename; //Where to store it ofn.nMaxFile = len; //Tell it how big the char array is ofn.lpstrTitle = ("Save a File"); //Title ofn.Flags = OFN_HIDEREADONLY|OFN_PATHMUSTEXIST; //Any flags here return GetSaveFileName(&ofn); //Display dialog box } Steve De Chellis
Jul 31 2002
See if you can used the attached files. Good luck! Jan Steve & Denise De Chellis wrote:How do I set up the common save dialog to deal with multiple filters? I want it to append the proper extension to the file when saving. I'm using this: BOOL GetFileNameSave(char *filename, int len, HWND hWnd) { OPENFILENAME ofn; ZeroMemory(&ofn, sizeof(OPENFILENAME)); //Zero out the memory for the filename info ofn.lStructSize = sizeof(OPENFILENAME); //Size of the structure ofn.hwndOwner = hWnd; //Window that is calling this if(nUID>=2000) { ofn.lpstrFilter = ("HackMaster Files (*.hmf)\0*.hmf\0HTM Files (*.htm)\0*.htm\0HTML Files (*.html)\0*.html\0"); //Filters } if(nUID<2000) { ofn.lpstrFilter = ("HTM Files (*.htm)\0*.htm\0HTML Files (*.html)\0*.html\0"); //Filters } ofn.lpstrFile = filename; //Where to store it ofn.nMaxFile = len; //Tell it how big the char array is ofn.lpstrTitle = ("Save a File"); //Title ofn.Flags = OFN_HIDEREADONLY|OFN_PATHMUSTEXIST; //Any flags here return GetSaveFileName(&ofn); //Display dialog box } Steve De Chellis
Jul 31 2002
Unfortunately for me I do not use classess much in this program. I was hoping their was something simple that I would use in OPENFILENAME that would automaticaly use the appropriate extension based on the current filter selection. Steve De Chellis "Jan Knepper" <jan smartsoft.cc> wrote in message news:3D486A5B.B791F5CA smartsoft.cc...See if you can used the attached files. Good luck! Jan Steve & Denise De Chellis wrote:wantHow do I set up the common save dialog to deal with multiple filters? Itheit to append the proper extension to the file when saving. I'm using this: BOOL GetFileNameSave(char *filename, int len, HWND hWnd) { OPENFILENAME ofn; ZeroMemory(&ofn, sizeof(OPENFILENAME)); //Zero out the memory forfilename info ofn.lStructSize = sizeof(OPENFILENAME); //Size of the structure ofn.hwndOwner = hWnd; //Window that is calling this if(nUID>=2000) { ofn.lpstrFilter = ("HackMaster Files (*.hmf)\0*.hmf\0HTM Files (*.htm)\0*.htm\0HTML Files (*.html)\0*.html\0"); //Filters } if(nUID<2000) { ofn.lpstrFilter = ("HTM Files (*.htm)\0*.htm\0HTML Files (*.html)\0*.html\0"); //Filters } ofn.lpstrFile = filename; //Where to store it ofn.nMaxFile = len; //Tell it how big the char array is ofn.lpstrTitle = ("Save a File"); //Title ofn.Flags = OFN_HIDEREADONLY|OFN_PATHMUSTEXIST; //Any flags here return GetSaveFileName(&ofn); //Display dialog box } Steve De Chellis
Jul 31 2002
Well, the class isn't that difficult to use... Jan Steve & Denise De Chellis wrote:Unfortunately for me I do not use classess much in this program. I was hoping their was something simple that I would use in OPENFILENAME that would automaticaly use the appropriate extension based on the current filter selection. Steve De Chellis "Jan Knepper" <jan smartsoft.cc> wrote in message news:3D486A5B.B791F5CA smartsoft.cc...See if you can used the attached files. Good luck! Jan Steve & Denise De Chellis wrote:wantHow do I set up the common save dialog to deal with multiple filters? Itheit to append the proper extension to the file when saving. I'm using this: BOOL GetFileNameSave(char *filename, int len, HWND hWnd) { OPENFILENAME ofn; ZeroMemory(&ofn, sizeof(OPENFILENAME)); //Zero out the memory forfilename info ofn.lStructSize = sizeof(OPENFILENAME); //Size of the structure ofn.hwndOwner = hWnd; //Window that is calling this if(nUID>=2000) { ofn.lpstrFilter = ("HackMaster Files (*.hmf)\0*.hmf\0HTM Files (*.htm)\0*.htm\0HTML Files (*.html)\0*.html\0"); //Filters } if(nUID<2000) { ofn.lpstrFilter = ("HTM Files (*.htm)\0*.htm\0HTML Files (*.html)\0*.html\0"); //Filters } ofn.lpstrFile = filename; //Where to store it ofn.nMaxFile = len; //Tell it how big the char array is ofn.lpstrTitle = ("Save a File"); //Title ofn.Flags = OFN_HIDEREADONLY|OFN_PATHMUSTEXIST; //Any flags here return GetSaveFileName(&ofn); //Display dialog box } Steve De Chellis
Jul 31 2002