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. Closing application in InitDialog()

Closing application in InitDialog()

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
7 Posts 4 Posters 4 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
    Sameer Maggon
    wrote on last edited by
    #1

    Hi, How do i close my application in InitDialog() According to some checkings i want to terminate my application.. I've tried EndDialog.. and DestroyWindow() Please help

    H 1 Reply Last reply
    0
    • S Sameer Maggon

      Hi, How do i close my application in InitDialog() According to some checkings i want to terminate my application.. I've tried EndDialog.. and DestroyWindow() Please help

      H Offline
      H Offline
      Hans Ruck
      wrote on last edited by
      #2

      As i understand, your application is a dialog-based one? rechi

      S 1 Reply Last reply
      0
      • H Hans Ruck

        As i understand, your application is a dialog-based one? rechi

        S Offline
        S Offline
        Sameer Maggon
        wrote on last edited by
        #3

        Yes, my application is a Dialog Based MFC Application

        H 1 Reply Last reply
        0
        • S Sameer Maggon

          Yes, my application is a Dialog Based MFC Application

          H Offline
          H Offline
          Hans Ruck
          wrote on last edited by
          #4

          Then, it should work with EndDialog. I've created a test application and i've put: EndDialog(0); // adding this!!! return TRUE; // return TRUE unless you set the focus to a control The application is stopping immediately. rechi

          A 1 Reply Last reply
          0
          • H Hans Ruck

            Then, it should work with EndDialog. I've created a test application and i've put: EndDialog(0); // adding this!!! return TRUE; // return TRUE unless you set the focus to a control The application is stopping immediately. rechi

            A Offline
            A Offline
            AlexMarbus
            wrote on last edited by
            #5

            You can call EndDialog, but don't use '0' as argument: use IDOK or IDCANCEL instead. -- Alex Marbus www.marbus.net But then again, I could be wrong.

            H T 2 Replies Last reply
            0
            • A AlexMarbus

              You can call EndDialog, but don't use '0' as argument: use IDOK or IDCANCEL instead. -- Alex Marbus www.marbus.net But then again, I could be wrong.

              H Offline
              H Offline
              Hans Ruck
              wrote on last edited by
              #6

              OK, OK... 0 was just a random value to see if EndDialog works fine. rechi

              1 Reply Last reply
              0
              • A AlexMarbus

                You can call EndDialog, but don't use '0' as argument: use IDOK or IDCANCEL instead. -- Alex Marbus www.marbus.net But then again, I could be wrong.

                T Offline
                T Offline
                Tim Smith
                wrote on last edited by
                #7

                You can use 0. You can use 13259. The argument to EndDialog is just the value that is returned to the application. IDOK and IDCANCEL are used so application can tell which control closed the dialog. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?

                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