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. Exit an application

Exit an application

Scheduled Pinned Locked Moved C / C++ / MFC
c++csharpmcpquestion
5 Posts 5 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.
  • G Offline
    G Offline
    Gagnon Claude
    wrote on last edited by
    #1

    Hi, I program with Visual C++ .NET 2003. I have an application that I want to quit if a specific date is passed. (the user will not choose Quit in the menu) I want to terminate the application in the OnClose member function of my CApplicationView class. I have tried with various methods like PostMessage(WM_DESTROY, 0, 0) or PostQuitMessage(0) without success. Does anybody have suggestions ? Thanks, Claude

    B I D T 4 Replies Last reply
    0
    • G Gagnon Claude

      Hi, I program with Visual C++ .NET 2003. I have an application that I want to quit if a specific date is passed. (the user will not choose Quit in the menu) I want to terminate the application in the OnClose member function of my CApplicationView class. I have tried with various methods like PostMessage(WM_DESTROY, 0, 0) or PostQuitMessage(0) without success. Does anybody have suggestions ? Thanks, Claude

      B Offline
      B Offline
      BlackDice
      wrote on last edited by
      #2

      exit() ? My articles www.stillwaterexpress.com BlackDice

      1 Reply Last reply
      0
      • G Gagnon Claude

        Hi, I program with Visual C++ .NET 2003. I have an application that I want to quit if a specific date is passed. (the user will not choose Quit in the menu) I want to terminate the application in the OnClose member function of my CApplicationView class. I have tried with various methods like PostMessage(WM_DESTROY, 0, 0) or PostQuitMessage(0) without success. Does anybody have suggestions ? Thanks, Claude

        I Offline
        I Offline
        Ivan Cachicatari
        wrote on last edited by
        #3

        Try with this code. PostMessage(WM_COMMAND,ID_APP_EXIT); Ivan Cachicatari Blog[^] www.latindevelopers.com

        1 Reply Last reply
        0
        • G Gagnon Claude

          Hi, I program with Visual C++ .NET 2003. I have an application that I want to quit if a specific date is passed. (the user will not choose Quit in the menu) I want to terminate the application in the OnClose member function of my CApplicationView class. I have tried with various methods like PostMessage(WM_DESTROY, 0, 0) or PostQuitMessage(0) without success. Does anybody have suggestions ? Thanks, Claude

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

          The correct method is PostMessage(WM_CLOSE).


          "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

          1 Reply Last reply
          0
          • G Gagnon Claude

            Hi, I program with Visual C++ .NET 2003. I have an application that I want to quit if a specific date is passed. (the user will not choose Quit in the menu) I want to terminate the application in the OnClose member function of my CApplicationView class. I have tried with various methods like PostMessage(WM_DESTROY, 0, 0) or PostQuitMessage(0) without success. Does anybody have suggestions ? Thanks, Claude

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            You can try PostMessage(WM_QUIT,0,0) too.

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta

            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