Hi im learning c++ and i want to create a windows form application that basically you can type in the file name then click a button that runs the file. Everything will be in the same directory. I was wondering if you guys could get me started. =)
Basically i want to create a program the can run other programs through it.
Say you want to be able to start ventrilo.
You would then type ventrilo.exe into the text field, then click a button to launch the program.
I think this is possible im just not sure how to code it.
I also dont want to use the "system" code as it hangs up the program until cancelled.
This is what i have but i dont want to use this anymore, the button runs the program directly rather then typing the name into the text field, not exact either but you get the point.
Well, textBox1.Text() should return a System::String of the text, I think. You want a char* here. I think it might be better not to mix .NET and WinAPI libraries. Try replacing CreateProcess with http://msdn.microsoft.com/en-us/library/53ezey2s.aspx
For a reference, search msdn. For more basic questions, find yourself a C++ CLI tutorial.
private: System::Void textBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) {
//
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
String^ myTextBox = // Need help figuring out how to string from textBox1 to here
Process::Start( myTextBox );