"Save as type" problem

This is a discussion on "Save as type" problem within the Windows Programming forums, part of the Platform Specific Boards category; Hi all, Any of you have an idea on how to change the "save as type: " from "*.*" to ...

  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,705
    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 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,789
    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, 10: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21