I'm using C++ .NET 2.0
I have 2 forms
the first one is declared as follow
#include "stdafx.h"
namespace myNamespace{
public ref class frmMain : public System::Windows::Forms::Form {
/*... snip ...*/
public void addNewRow(String^ text){ /*... snip... */ }
public void launchSubForm() { SubForm^ sf = gcnew SubForm(this); sf->Show(); }
};
}
the second one goes like this
#include stdafx.h
namespace myNamespace{
ref class frmMain;
public ref class SubForm : public System::Windows::Forms::Form {
frmMain^ myMain;
SubForm ( frmMain^ pMain){
myMain = pMain;
}
/*... snip ...*/
public void exportRows(String^ text){ /*... snip... */ }
myMain->addNewRow("myNewText"); <--- This line causes compile error
};
}
in stdafx.h i have
/*... snip... */
#include "SubForm.h"
#include "frmMain.h"
Now to the question! The line in SubForm causes the compiler to tell me "use of undefined type myNamespace::frmMain
I really have no clue about why the "ref class frmMain" doesnt solve this problem