First problem first.
When you exit from a previous window, type in a text box and press enter, your app exits?
Can you trap any exceptions (is an exception actually thrown)?
What is the data type bound to your textbox?
Are you trapping keypresses?
thines01
Postaholic
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
That has been a common problem for many years with MFC. The way to solve it is to hook the keyboard event and ignore the Enter key.
Here are a few more suggestions
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343