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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

739 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