Solved

Unfortunately ending a program...

Posted on 2000-05-02
2
177 Views
Last Modified: 2010-04-02
We are making a Visual c++ program. But every time we accidentaly push the "enter"-button, the program ends. Why????
0
Comment
Question by:liberator
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
MDarling earned 50 total points
ID: 2768964
I suspect you have a default button with ID IDOK - you could map this ID OnClicked event to an empty function and that would solve your problem.  Alternatively you could change the buttons ID.

regards,
Mike.
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 2768970
Hi liberator,

What kind of application is it? If it's a dialog based application simply override the dialog's OnOK() function and don't call CDialog::OnOK() in there.

ZOPPO
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Handle Exceptions during instantiation 28 429
Grammars for C C++ and java 1 139
How can i compile this github project?? 2 99
C++ Code Issue 4 38
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question