Dumb Question- How to open a .exe file from a form

closed account (iG3b7k9E)
How do you make a form open a .exe file that is somewhere else in the computer? I know this is a dumb question, but this is my first year programing and I'm trying to teach my self. Plus it is hard to find a teacher when you are in middle school.

Another problem I have is that when I make my calculators, I don't know how to make division find the decimal. Here is my calculator programing:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
			 if (this->comboBox1->Text == "+")
				 this->textBox3->Text = System::Convert::ToString
                 ( System::Convert::ToInt16( this->textBox1->Text )
                 + System::Convert::ToInt16 ( this->textBox2->Text ));
			 if (this->comboBox1->Text == "-")
				 this->textBox3->Text = System::Convert::ToString
                 ( System::Convert::ToInt16( this->textBox1->Text )
                 - System::Convert::ToInt16 ( this->textBox2->Text ));
			 if (this->comboBox1->Text == "x")
				 this->textBox3->Text = System::Convert::ToString
                 ( System::Convert::ToInt16( this->textBox1->Text )
                 * System::Convert::ToInt16 ( this->textBox2->Text ));
			 if (this->comboBox1->Text == "/")
				 this->textBox3->Text = System::Convert::ToString
                 ( System::Convert::ToInt16( this->textBox1->Text )
                 / System::Convert::ToInt16 ( this->textBox2->Text ));
			 if (this->comboBox1->Text == "r")
				 this->textBox3->Text = System::Convert::ToString
                 ( System::Convert::ToInt16( this->textBox1->Text )
                 % System::Convert::ToInt16 ( this->textBox2->Text ));
		 }

If anybody knows how to do ether of these things please tell me how.
Last edited on
For opening a process u can use system()
Also look up CreateProcess() for Windows.
And for the division I think you have to convert your values to a real number and add as many zeros to the number after the decimal as u want.

Like, if the form gets the input 6 and 4 u should convert the numbers to 6.0 and 4.0 respectively and u should get an answer accurate up to 1 decimal point.

There r no dumb questions ;)
Topic archived. No new replies allowed.