Hi,
I am trying to access variables from the header file of my main form (Form1.h) in the header file of a different form (Form2.h). I am trying to pass a pointer of my main form (Form1) to the second form(Form2), however I am getting errors.
In Form1.h:
#include "Form2.h" Form1(void){ InitializeComponent(); f2 = gcnew Form2(this); }
In Form2.h:
#include "Form1.h" public: Form1 parentForm; ProfileNameWindow(Form1 pForm) { InitializeComponent(); parentForm = pForm; }
It seems to have problems with the fact that I am including the Form1.h header file in the Form2.h header file.
Any help that anyone could provide would be greatly appreciated. Thanks!