Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Communicating Between Multiple Forms

$
0
0

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!


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>