So currently i am trying to #include "MyForm.h" in "MyForm1.h" but "MyForm.h" already has #include"MyForm1.h" in the top of it and for some reason when i try to put the include in MyForm1 i get a multitude of errors
1 2 3 4 5 6 7 8 9 10 11 12 13
//Errors
Severity Code Description Project File Line Suppression State
Error C2061 syntax error: identifier 'MyForm1' CppWinForm2 2015\projects\cppwinform2\cppwinform2\MyForm.h 168
Error C2227 left of '->ShowDialog' must point to class/struct/union/generic type CppWinForm2 2015\projects\cppwinform2\cppwinform2\MyForm.h 169
Error C2065 'MyForm1': undeclared identifier CppWinForm2 2015\projects\cppwinform2\cppwinform2\MyForm.h 168
Error C2065 'f2': undeclared identifier CppWinForm2 2015\projects\cppwinform2\cppwinform2\MyForm.h 168
Error C2065 'f2': undeclared identifier CppWinForm2 2015\projects\cppwinform2\cppwinform2\MyForm.h 169
//The code the errors refer to\
this->Hide();
MyForm1^ f2 = gcnew MyForm1();
f2->ShowDialog();
this->Close();
As as soon as i remove #include "MyForm.h" from MyForm1.h these errors no longer exist, the reason iwant to connected the two files is so that i can take the input from a textbox on MyForm and open a New form (MyForm1) which has a label that says what they typed.