This is the soruce code for a win32 prog that you enter two numbers and select your operator to go between them and then it outputs and answer. It's under 2K zipped and I appreciate anyone who will take the time to read it! Thanks!
This is the soruce code for a win32 prog that you enter two numbers and select your operator to go between them and then it outputs and answer. It's under 2K zipped and I appreciate anyone who will take the time to read it! Thanks!
>please read this source code and tell me what is wrong
hm... this is your compilers job. It will do it in a minute if you try.
If you don't get what the errormessage means, come back here and post it.
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.
Sorry, I should have been more specific. The program compiles fine, but doesn't work "right" ie how I want it to. I am not asking for any source code, just an explanation of what is wrong. Thanks for your time.
How does it "not work right"? What are the symptoms?
1978 Silver Anniversary Corvette
It doesn't add/subtract/multiply/divide the numbers when you enter two numbers and click a operator button. It gives out a seemingly random number, not the right answer. Here is the exec file, It not virused or anything.
-> make "numone" and "numtwo" static, otherwise they will lose their value.
->your use of GetDlgItemInt is wrong
numone=GetDlgItemInt(hDlg,IDC_NUMONE,NULL,TRUE);
->it is better to check also if you change your operation (+,-,*,/)
one more thing: in your "Calculate" function, check if numtwo is zero. It is safer. press the '/' button before entering a number in numtwo and see what happensCode:case IDC_PLUS: case IDC_MINUS: case IDC_MULTIPLY: case IDC_DIVIDE: Calculate(hDlg,numone,numtwo); break;
Hey thanks maes, it works right now. I really appreciate it!
Hey thanks maes, it works right now. I really appreciate it!