473,385 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Math Output in DialogBased Program With MSVC++

4
Hi friends:
I know this question might seem very simple but I need it urgently for my homework.

"Imagine I want to write a dialogbased program.It takes two integers (m_a and m_b) from user and shows the sum of them as result.It contains three edit boxes and a button control to exe the sum process.I use the following command:

void CMATHDlg::OnSum()
{
m_sum=m_a+m_b;
MessageBox(m_sum);
UpdateData(TRUE);
}


But after running, the sum result does not appear in the related editbox.And also it gives me error for type conversion.

WHAT COMMAND SHOULD I USE INSTEAD OF MessageBox?

I also will be thankful if you could introduce me a book for mathematical aspects of vcpp.

Thank you so much
Jun 16 '07 #1
6 1767
Savage
1,764 Expert 1GB
Hi friends:
I know this question might seem very simple but I need it urgently for my homework.

"Imagine I want to write a dialogbased program.It takes two integers (m_a and m_b) from user and shows the sum of them as result.It contains three edit boxes and a button control to exe the sum process.I use the following command:

void CMATHDlg::OnSum()
{
m_sum=m_a+m_b;
MessageBox(m_sum);
UpdateData(TRUE);
}


But after running, the sum result does not appear in the related editbox.And also it gives me error for type conversion.

WHAT COMMAND SHOULD I USE INSTEAD OF MessageBox?

I also will be thankful if you could introduce me a book for mathematical aspects of vcpp.

Thank you so much
Let me see now:

Do you wish to show result in editbox or in a message box?

Savage
Jun 16 '07 #2
cyrus
4
Let me see now:

Do you wish to show result in editbox or in a message box?

Savage
Hi:

Of course I think showing the result in editbox will be more suitable but would you please tell me about both (showing in messagebox or editbox)

Thank you
Jun 17 '07 #3
Savage
1,764 Expert 1GB
Hi:

Of course I think showing the result in editbox will be more suitable but would you please tell me about both (showing in messagebox or editbox)

Thank you
If you want to display it into MessageBox,use method show:


MessageBox::Show(String^ text,String^Caption,MessageBoxbuttons,MessageBoxIc on);

e.g:

MessageBox::Show(result,"Result is",MessageBoxButtons::OK,MessageBoxIcon::Informat ion)

for TextBox,see Text property..

Also you will need to convert from int to String^
Savage
Jun 17 '07 #4
cyrus
4
If you want to display it into MessageBox,use method show:


MessageBox::Show(String^ text,String^Caption,MessageBoxbuttons,MessageBoxIc on);

e.g:

MessageBox::Show(result,"Result is",MessageBoxButtons::OK,MessageBoxIcon::Informat ion)

for TextBox,see Text property..

Also you will need to convert from int to String^
Savage
Thank you so much Savage
Would you please tell me about the showing in editbox too.I check "Want return" in style tab but should I add a function like EN_CHANGE OR EN_UPDATE?

Thank you again
Jun 18 '07 #5
cyrus
4
Thank you so much Savage
Would you please tell me about the showing in editbox too.I check "Want return" in style tab but should I add a function like EN_CHANGE OR EN_UPDATE?

Thank you again
I know you might be busy but please take a look at this example in :
http://rapidshare.com/files/37902951/MATHOUTPUT.rar

It's not my main project I only created a simple example to learn the way math result can be shown in edit box.

Thank you
Jun 18 '07 #6
Savage
1,764 Expert 1GB
I know you might be busy but please take a look at this example in :
http://rapidshare.com/files/37902951/MATHOUTPUT.rar

It's not my main project I only created a simple example to learn the way math result can be shown in edit box.

Thank you
You are usimg VC 6,right?

I'm using Microsoft Vc express 2005,so I have some problems viewing your project.

Sorry,but I think that there is no editbox in M$ VC but there is textbox.They are same,I think.If they are same check for Text methode..

Savage
Jun 18 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jussi Mononen | last post by:
Hi, I'm having problems to successfully execute the test scripts on a Compaq host ( OSF1 tr51bdev V5.1 2650 alpha ). Almost all tests end up with the following error message "PARI: *** ...
1
by: limelight | last post by:
I have discovered a math error in the .NET framework's Log function. It returns incorrect results for varying powers of 2 that depend on whether the program is run from within the IDE or from the...
17
by: cwdjrxyz | last post by:
Javascript has a very small math function list. However there is no reason that this list can not be extended greatly. Speed is not an issue, unless you nest complicated calculations several levels...
3
by: David | last post by:
Here is some code. I am trying to figure out how to raise, say, x to the yth power. I know that isn't explicitly what is in the code but that is the idea I am trying to solve. See the 2nd for...
15
by: Ingmar | last post by:
Simple comparison tests we have performed show that System.Math functions in C# are much slower than corresponding functions in C++. Extreme examples are System.Math.Exp() and System.Math.Tan(),...
7
by: Wernfried Schwenkner | last post by:
I've found the discussion about Math.Log and the error with Math.Log(8,2) on Google. Unfortunatly the full thread isn't on my news server, so I can't reply. The problem doesn't only depend...
2
by: Kyle0654 | last post by:
I've been searching for a solution to this problem for a while but haven't hit upon anything yet. Details: Using: MSVC++ .NET 2003 App type: Windows Forms Application (Managed C++)...
7
by: Mark Healey | last post by:
Do the trig functions in math.h work in degrees, radians or what? For some reason it doesn't say which in "man math.h" IIRC the arctan of a slope gives the angle. So, shouldn't atanf((float)1)...
38
by: Jordi | last post by:
I have made a little C program that generates the following output: 227.000000 / 5 = 45.400002 Here's the code: int main (int argc, char* argv) { float var = 227; printf("%f / 5 = %f\n", var,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.