Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1054
  • Last Modified:

A graphical calculator in c++

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
Azadeh
Asked:
Azadeh
1 Solution
 
jhanceCommented:
Homework problem perhaps?
0
 
IainHereCommented:
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
 
griesshCommented:
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
 
MindphaserCommented:
Force accepted

** Mindphaser - Community Support Moderator **

0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now