Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


A graphical calculator in c++

Posted on 2002-06-15
Medium Priority
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
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
LVL 32

Expert Comment

ID: 7080351
Homework problem perhaps?

Accepted Solution

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.
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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…

705 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