I've been there, tried that.... :(
here is the error message i'm getting
c:\src\msvs8beta2\c++\newkiosk\mainapp\mainapp\frm Imaging.h(66) : error
C2512:
'MainApp::frmMain' : no appropriate default constructor available
and the source code is :
ref class frmMain;
public ref class frmImaging : public System::Windows::Forms::Form {
public:
frmImaging(void) {
InitializeComponent();
}
private:
System::Void frmImaging_Shown(System::Object^ sender, System::EventArgs^
e) {
frmMain^ o = gcnew frmMain();
}
};//EOF Class
//////////////////////////////////////////////////
// form1.h
#include "form2.h"
ref class form1 {
public:
void foo(form2^ f) {
// do stuff with form 2
}
};
// form2.h
ref class form1;
ref class form2 {
public:
void bar(form1^ f);
};
// form2.cpp
#include "form1.h"
void form1::bar(form1^ f) {
// do stuff with form 1
}
Generally co-dependence between classes like this is indicative of a
non-optimal design. Think about how you can change the composition of
your application to avoid this kind of pattern - it's usually possible,
especially between high level UI concepts like forms.
-cd