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. DateTimePicker MFC - Return ends the program

DateTimePicker MFC - Return ends the program

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
8 Posts 3 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.
  • M Offline
    M Offline
    Mr Brainley
    wrote on last edited by
    #1

    I have a simple problem. I have a DataTimePicker MFC-Control in my Dialog, and whever i press enter while editing it, the application terminates. I have tried to override OnNotify and handle it myself, but that doesn't seem to work. I get the notification, i do something, then i return TRUE (from OnNotify), and then the application terminates. Any suggestions. ? wbr Mr.Brainley

    D M 2 Replies Last reply
    0
    • M Mr Brainley

      I have a simple problem. I have a DataTimePicker MFC-Control in my Dialog, and whever i press enter while editing it, the application terminates. I have tried to override OnNotify and handle it myself, but that doesn't seem to work. I get the notification, i do something, then i return TRUE (from OnNotify), and then the application terminates. Any suggestions. ? wbr Mr.Brainley

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

      Mr.Brainley wrote:

      I have a DataTimePicker MFC-Control in my Dialog, and whever i press enter while editing it, the application terminates.

      Have you tried to reproduce this by creating another such application, but only adding the control to the dialog template, nothing else?

      Mr.Brainley wrote:

      I get the notification, i do something, then i return TRUE (from OnNotify), and then the application terminates. Any suggestions. ?

      What happens if you return FALSE?


      "A good athlete is the result of a good and worthy opponent." - David Crow

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      M 1 Reply Last reply
      0
      • D David Crow

        Mr.Brainley wrote:

        I have a DataTimePicker MFC-Control in my Dialog, and whever i press enter while editing it, the application terminates.

        Have you tried to reproduce this by creating another such application, but only adding the control to the dialog template, nothing else?

        Mr.Brainley wrote:

        I get the notification, i do something, then i return TRUE (from OnNotify), and then the application terminates. Any suggestions. ?

        What happens if you return FALSE?


        "A good athlete is the result of a good and worthy opponent." - David Crow

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        M Offline
        M Offline
        Mr Brainley
        wrote on last edited by
        #3

        I have tried it to create a dialog with just a DateTime control, same behavior. If i returning false changes nothing.

        D 1 Reply Last reply
        0
        • M Mr Brainley

          I have tried it to create a dialog with just a DateTime control, same behavior. If i returning false changes nothing.

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

          Is this with VS6?


          "A good athlete is the result of a good and worthy opponent." - David Crow

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          M 1 Reply Last reply
          0
          • D David Crow

            Is this with VS6?


            "A good athlete is the result of a good and worthy opponent." - David Crow

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            M Offline
            M Offline
            Mr Brainley
            wrote on last edited by
            #5

            Yes it is.

            M 1 Reply Last reply
            0
            • M Mr Brainley

              Yes it is.

              M Offline
              M Offline
              Mr Brainley
              wrote on last edited by
              #6

              The control was inside a dialogbased MFC-Application, wich is basically a big modal dialog. Pressing Enter triggered the OnOK event, wich by default terminates the application. I can avaid that now.

              D 1 Reply Last reply
              0
              • M Mr Brainley

                The control was inside a dialogbased MFC-Application, wich is basically a big modal dialog. Pressing Enter triggered the OnOK event, wich by default terminates the application. I can avaid that now.

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

                But if the control was open (as you initially stated), pressing the Enter key would have simply closed the control, not the dialog. As you've now descibed it, the control was actually closed, which the default behavior would have been to call the OnOK() method.


                "A good athlete is the result of a good and worthy opponent." - David Crow

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                1 Reply Last reply
                0
                • M Mr Brainley

                  I have a simple problem. I have a DataTimePicker MFC-Control in my Dialog, and whever i press enter while editing it, the application terminates. I have tried to override OnNotify and handle it myself, but that doesn't seem to work. I get the notification, i do something, then i return TRUE (from OnNotify), and then the application terminates. Any suggestions. ? wbr Mr.Brainley

                  M Offline
                  M Offline
                  Mark Salsbery
                  wrote on last edited by
                  #8

                  Mr.Brainley wrote:

                  and whever i press enter while editing it, the application terminates.

                  Is the dialog your main window?  Mark

                  Mark Salsbery Microsoft MVP - Visual C++ :java:

                  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