I have a class that stores all of my variables and functions (for our purposes, DataClass), and a few different windows form classes that use the public variables and functions in DataClass.
I need to keep the values of the public variables in DataClass until the program closes.
I set the values of public member variables of DataClass in form1 class:
DataClass data; data.m_sComPort = "COM1"; data.m_sBaudRate = "19200";
Then I close form1 to open form2 (Next button):
OnCancel(); form2 frm2dlg; frm2dlg.DoModal();
form2 opens, and the values of the variables in DataClass that I just set in form1 are gone.
How do I not lose the values of those variables when going from form1 to form2?
This is my first post and thread, but DaniWeb has been a great resource for me for some time. Thanks.