DateTimePicker MFC - Return ends the program
-
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
-
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
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
-
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
I have tried it to create a dialog with just a DateTime control, same behavior. If i returning false changes nothing.
-
I have tried it to create a dialog with just a DateTime control, same behavior. If i returning false changes nothing.
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
-
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
Yes it is.
-
Yes it is.
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.
-
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.
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
-
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
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: