Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Saving Documents Without Confimation Dialog

Saving Documents Without Confimation Dialog

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    volkan878
    wrote on last edited by
    #1

    Hi, I have an MDI project. When some changes occur in a view i call the view's document's SetModifiedFlag() method and when the user attempts to close the child frame, it asks to save the recent changes and that's OK. I also have a Save Project button on the toolbar and when it is pressed it calls CDocTemplate::SaveAllModified() method and saves the modified documents but the problem is it still pops a confirmation dialog. It looks rather silly when the user presses "Save" and it says "Do you want to save?".. Is there a way that i can "silently" save the documents without displaying the confirmation dialog box? Any idea is welcome. Thanks in advance.

    A A D 3 Replies Last reply
    0
    • V volkan878

      Hi, I have an MDI project. When some changes occur in a view i call the view's document's SetModifiedFlag() method and when the user attempts to close the child frame, it asks to save the recent changes and that's OK. I also have a Save Project button on the toolbar and when it is pressed it calls CDocTemplate::SaveAllModified() method and saves the modified documents but the problem is it still pops a confirmation dialog. It looks rather silly when the user presses "Save" and it says "Do you want to save?".. Is there a way that i can "silently" save the documents without displaying the confirmation dialog box? Any idea is welcome. Thanks in advance.

      A Offline
      A Offline
      Azghar Hussain
      wrote on last edited by
      #2

      Hi, I Think this is possible. Just try to overwrite the CFileDialog() or Do the serialization by skipping CFileDialog(). This is a huge mess I think. I am tryieng this application by myself. If I get the solution I will surely let u know. bbye Salman Live and Let live

      1 Reply Last reply
      0
      • V volkan878

        Hi, I have an MDI project. When some changes occur in a view i call the view's document's SetModifiedFlag() method and when the user attempts to close the child frame, it asks to save the recent changes and that's OK. I also have a Save Project button on the toolbar and when it is pressed it calls CDocTemplate::SaveAllModified() method and saves the modified documents but the problem is it still pops a confirmation dialog. It looks rather silly when the user presses "Save" and it says "Do you want to save?".. Is there a way that i can "silently" save the documents without displaying the confirmation dialog box? Any idea is welcome. Thanks in advance.

        A Offline
        A Offline
        Anand Paranjpe
        wrote on last edited by
        #3

        (Grab active window, click the button with name "&save") U will find such program on net which will do this for u. e.g. dismiss.exe which will do the same explained on 1st line. The chosen One :)

        1 Reply Last reply
        0
        • V volkan878

          Hi, I have an MDI project. When some changes occur in a view i call the view's document's SetModifiedFlag() method and when the user attempts to close the child frame, it asks to save the recent changes and that's OK. I also have a Save Project button on the toolbar and when it is pressed it calls CDocTemplate::SaveAllModified() method and saves the modified documents but the problem is it still pops a confirmation dialog. It looks rather silly when the user presses "Save" and it says "Do you want to save?".. Is there a way that i can "silently" save the documents without displaying the confirmation dialog box? Any idea is welcome. Thanks in advance.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          volkan878 wrote: Is there a way that i can "silently" save the documents without displaying the confirmation dialog box? You'll need to override the CDocument::SaveModified() method to do everything the base class does sans the prompt.


          A rich person is not the one who has the most, but the one that needs the least.

          V 1 Reply Last reply
          0
          • D David Crow

            volkan878 wrote: Is there a way that i can "silently" save the documents without displaying the confirmation dialog box? You'll need to override the CDocument::SaveModified() method to do everything the base class does sans the prompt.


            A rich person is not the one who has the most, but the one that needs the least.

            V Offline
            V Offline
            volkan878
            wrote on last edited by
            #5

            Thank you all for your responses. I think the most efficient way for to overcome the problem, as DavidCrow suggested, will be overriding CDocument::SaveModified(). After David's post i wondered what MSDN says about SaveModified() and it says : "Called by the framework before a modified document is to be closed. The default implementation of this function displays a message box asking the user whether to save the changes to the document, if any have been made. Override this function if your program requires a different prompting procedure. This is an advanced overridable" So, altough i wished to discover a method like TurnOffTheStupidDialog(), i think i'll go for overriding it. Anyway, thank you again for your replies.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups