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. the Prompt save message

the Prompt save message

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 Posts 2 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.
  • S Offline
    S Offline
    susanne1
    wrote on last edited by
    #1

    Hallo in my SDI-Application i have the following problem: when i write something and click close or exit the application does not ask me if i want to save the document /file or not(the prompt message does not appear???) please help.

    D 1 Reply Last reply
    0
    • S susanne1

      Hallo in my SDI-Application i have the following problem: when i write something and click close or exit the application does not ask me if i want to save the document /file or not(the prompt message does not appear???) please help.

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

      Have you called the document's SetModifiedFlag() method?

      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      S 1 Reply Last reply
      0
      • D David Crow

        Have you called the document's SetModifiedFlag() method?

        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        S Offline
        S Offline
        susanne1
        wrote on last edited by
        #3

        i have now the following Code : When i click on the close or exit button, OnDeleteContents() will be called: void CTest_Doc::OnDeleteContents() { CDocument::DeleteContents (); CDocument::OnCloseDocument(); CDocument::SetModifiedFlag(1); } after that there is a heap problem???

        S 1 Reply Last reply
        0
        • S susanne1

          i have now the following Code : When i click on the close or exit button, OnDeleteContents() will be called: void CTest_Doc::OnDeleteContents() { CDocument::DeleteContents (); CDocument::OnCloseDocument(); CDocument::SetModifiedFlag(1); } after that there is a heap problem???

          S Offline
          S Offline
          susanne1
          wrote on last edited by
          #4

          okay i corrected : void CTest_Doc::OnDeleteContents() { CDocument::SetModifiedFlag(1); CDocument::DeleteContents (); CDocument::OnCloseDocument(); } but the Prompt save message stiil not appear??

          D 1 Reply Last reply
          0
          • S susanne1

            okay i corrected : void CTest_Doc::OnDeleteContents() { CDocument::SetModifiedFlag(1); CDocument::DeleteContents (); CDocument::OnCloseDocument(); } but the Prompt save message stiil not appear??

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

            susanne1 wrote:

            but the Prompt save message stiil not appear??

            Because you are possibly calling SetModifiedFlag() too late. It needs to be called as soon as the document changes.

            "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            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