I am trying to create a windows form using visual c++. I type the variable value in the text box in windows and read it in by clicking a button. The variable is now stored in the form1.h header file.
I want to use that variable in the my_proj.cpp code, what should I do?
Thanks!
//part of the form1.h file
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
// read in from the text box my clicking the button
int var1 = System::Int32::Parse(textBox1->Text);
printf("%d\n", var1);
}
//part of my_proj.cpp
Application::Run(gcnew Form1());
int var1;
printf("%d\n", var1);