When I try to use #include “CFIS_Main.h” statement in form “For_Student_Details.h”,
Its not accepting…Anybody can point me the mistake? Thanks for the helps..
MyProject.cpp
// MyProject.cpp : main project file.
#include "stdafx.h"
#ifndef CFIS_Main_h
#define CFIS_Main_h
#include "CFIS_Main.h"
#endif
using namespace MyProject;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Create the main window and run it
Application::Run(gcnew CFIS_Main());
return 0;
}
My Codes from MdiParent
//CFIS_Main.h IsMdiContainer = True
#include "For_Student_Detials"
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
For_Student_Detials^ MyStudentDet= For_Student_Detials::GetForm(true,this);
MyStudentDet->MdiParent=this;
MyStudentDet->FormBorderStyle=System::Windows::Forms::FormBorderStyle::None;
MyStudentDet->Dock=DockStyle::Fill;
MyStudentDet->Show();
}
My Codes From MdiChild For_Student_Details
#include "CFIS_Main.h" Why Not included...?????
public: static For_Student_Details^ For_Student_Details::_instance = nullptr;
public: static For_Student_Details^ For_Student_Details::GetForm(bool^ IsMDIChild, CFIS_Main^ MyInstFrm) {
if (_instance == nullptr)
_instance = gcnew For_Student_Details();
if (_instance->IsDisposed)
_instance = gcnew For_Student_Details();
if (IsMDIChild)
_instance->MdiParent = MyInstFrm;
return _instance;
}
Receiving The Below errors
error C2061: syntax error : identifier 'CFIS_Main'
error C2065: 'MyInstFrm' : undeclared identifier
error C2660: 'CashFlow_InformationsSystem::For_Loan_Details::GetForm' : function does not take 2 arguments
From the above code, Its not including CFIS_Main, I can’t identify my mistake, Does anybody can point me?
Thanks For The Helps
You have a circular header reference:
You will need to resolve this circular dependency.
The easiest way to do so is to leave only the function declaration for
button1_Click()in “CFIS_Main.h” and move the definition into “MyProject.cpp”, where you also include “For_Student_Details”.You will also have to define (or include the right header) the type
CFIS_Mainreferenced inFor_Student_Details::GetForm()(this might be resolved once you fix the circular include problem)Also, place the include guards in your header files, not the .cpp files