if (_instance->IsDisposed)
_instance = gcnew Form2();
if (IsMDIChild)
_instance->MdiParent = MyInstFrm;
return _instance;
}
But its giving below error
error C2065: 'Form2' : undeclared identifier
error C2065: 'MyEmpLoan' : undeclared identifier
error C2653: 'Form2' : is not a class or namespace name
Thanks
Move both forms implementation to .cpp file. By default, Windows Forms designer places all code to h-file (possibly because it works by the same algorithm for all .NET languages).
Having implementation in .cpp file, you can use forward declaration in .h file, and include both .h files to .cpp - standard C++ way to resolve circular dependencies.
Do the same with Form2. Now, move
#include "Form2.h"
from Form1.h to Form1.cpp. Only if necessary, add forward declaration to Form1.h:
ref class Form2;
Do the same with Form2.
Last edited by Alex F; June 14th, 2012 at 12:12 PM.
Bookmarks