We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,231 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Implement Backspace button in Calculator MFC?

First off, this is a homework assignment.

I am in a Software Engineering class and we're learning how to work with MFC. We're editing a basic calculator app. I don't know how to implement the backspace button (delete a single character from the edit box when the Backspace button is pressed). How is this done? I know that you can emulate character deletion with manipulation of char arrays in C++, but I don't know how you would do this with a number and in MFC. The application uses double integers.

2
Contributors
3
Replies
5 Days
Discussion Span
3 Months Ago
Last Updated
4
Views
greatman05
Light Poster
25 posts since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

how are you catching keystrokes and writing to the window?

Ancient Dragon
Achieved Level 70
Team Colleague
32,139 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,577
Skill Endorsements: 69

The buttons are part of the message map. When the buttons are clicked, it sends the message to Windows which then writes the output to the edit box in the calculator (it's a dialog box).

greatman05
Light Poster
25 posts since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Now that I think about it I don't recall ever seeing a calculator with a backspace. They have a Clear button that erases the entire line so that you can re-enter the entire number.

Ancient Dragon
Achieved Level 70
Team Colleague
32,139 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,577
Skill Endorsements: 69

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0653 seconds using 2.75MB