Thread: "Save as type" problem

  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    42

    "Save as type" problem

    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

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    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);
     }
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Set it in the contructor as in
    Code:
    "Chart Files (*.xlc)|*.xlc|Worksheet Files (*.xls)|*.xls|Data Files (*.xlc;*.xls)|*.xlc; *.xls|All Files (*.*)|*.*||";

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 04-08-2009, 11:47 AM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM