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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. who handles ID_FILE_CLOSE

who handles ID_FILE_CLOSE

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 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.
  • _ Offline
    _ Offline
    _T No name
    wrote on last edited by
    #1

    hello, can anybody help me to knw that who mainapp, doc and view handles ID_FILE_CLOSE i want to override this as i m using AFXPrintPreview(this) where this is ponter to view. in that case my main ribbon button contains a close buttton. On which i want to just close my preview nt application. my application is an SDI application. plz help thnakz

    E 1 Reply Last reply
    0
    • _ _T No name

      hello, can anybody help me to knw that who mainapp, doc and view handles ID_FILE_CLOSE i want to override this as i m using AFXPrintPreview(this) where this is ponter to view. in that case my main ribbon button contains a close buttton. On which i want to just close my preview nt application. my application is an SDI application. plz help thnakz

      E Offline
      E Offline
      Eytukan
      wrote on last edited by
      #2

      It's handled by the document. You may explain it better. Some notes from MSDN: ID_FILE_CLOSE Closes the currently open document. CDocument::OnFileClose calls CDocument::SaveModified to prompt the user to save the document if it has been modified and then calls OnCloseDocument. All the closing logic, including destroying the document, is done in the OnCloseDocument routine. ID_FILE_CLOSE acts differently from a WM_CLOSE message or an SC_CLOSE system command sent to the documents frame window. Closing a window will close the document only if that is the last frame window showing the document. Closing the document with ID_FILE_CLOSE will not only close the document but will close down all frame windows showing the document.

      He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus

      _ 1 Reply Last reply
      0
      • E Eytukan

        It's handled by the document. You may explain it better. Some notes from MSDN: ID_FILE_CLOSE Closes the currently open document. CDocument::OnFileClose calls CDocument::SaveModified to prompt the user to save the document if it has been modified and then calls OnCloseDocument. All the closing logic, including destroying the document, is done in the OnCloseDocument routine. ID_FILE_CLOSE acts differently from a WM_CLOSE message or an SC_CLOSE system command sent to the documents frame window. Closing a window will close the document only if that is the last frame window showing the document. Closing the document with ID_FILE_CLOSE will not only close the document but will close down all frame windows showing the document.

        He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus

        _ Offline
        _ Offline
        _T No name
        wrote on last edited by
        #3

        thanks for the reply... i could get it earlier but will it be ok from design point of view to call CmainFrame method from doc. i kindda need that.

        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