Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

A graphical calculator in c++

Posted on 2002-06-15
4
Medium Priority
?
1,053 Views
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?

Thnx,
Azadeh.
0
Comment
Question by:Azadeh
4 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 7080351
Homework problem perhaps?
0
 
LVL 4

Accepted Solution

by:
IainHere earned 80 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.
0
 
LVL 11

Expert Comment

by:griessh
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

     "IainHere"

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7332944
Force accepted

** Mindphaser - Community Support Moderator **

0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

963 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