I am trying to create my first windows form using visual C++. To create the form I use the following code in my .cpp file
I have functions such as 'updateTextBox(fas)' that sends some data to be output onto a text field on the form.Code:Form1^ fas; fas = gcnew Form1(); updateTextBox(fas); Application::Run(fas);
The problem is I am writing a function where I am unable to pass 'fas' as an argument. (the function is called from form.h). This function needs to update the text box as well and I have no way to tell the function what form to communicate with!
I thought about having 'fas' as a global variable but I cannot seem to do that. Is there any other way of referencing a form?