Solved

Unfortunately ending a program...

Posted on 2000-05-02
2
178 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

724 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