A graphical calculator in c++

Posted on 2002-06-15
Last Modified: 2012-06-27
Hi all:

I have problems in writing a proper code for a simple garphical calculator using visual c++, which does the 4 main operations in c++, it gets the oprands and operators via clicking each button. buttons are digits and aslo + -
* / % and ^ .

I do not know how to link the graphical calculator to the *.c or .cpp file?

Question by:Azadeh
LVL 32

Expert Comment

ID: 7080351
Homework problem perhaps?

Accepted Solution

IainHere earned 20 total points
ID: 7083412
jhance - yes it's homework, but at least Azadeh isn't asking someone to do it for them.

Azadeh - most people (certainly most beginners) writing dialogs in VC++ will use MFC, which makes doing these things easier.  Do you intend to use it?  If so, you could do this:

Select File->New.
Seleect the projects tab in the App wizard.
Select MFC Appwizard(exe)
Select Dialog based
Click finish.

You will now be shown a dialog resource, which is where you build your dialog.  Try compiling and running it now.

The dialog will be based on the CDialog class, and will be called C[name of app]Dlg.  Look for it in the class view.  Try adding the buttons you need to the dialog resource, double click on them and the wizard will add functions to the ...Dlg class to handle the clicking.

Perhaps you've done all of that, and all you need to know is how to access the other code you've written?  Well, you will/should have declared the functions in a header (.h) file, and defined them in an implementation (.c/.cpp/.cc) file.  Add both of those files to the project, and declare in the Dlg file (probably the .cpp) that you want to use the functions:

#include "MyHeader.h"

If you have any other problems, ask.
LVL 11

Expert Comment

ID: 7262336
Dear Azadeh

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept


comment(s) as an answer.


Expert Comment

ID: 7332944
Force accepted

** Mindphaser - Community Support Moderator **


Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now