Click here to Skip to main content
15,894,740 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi, Iam using VC++ 2010. While I want to get the MdiParent-Forms Instance, its giving the error, Really I can't identify my mistake...

My Codes from MdiParent
=======================
C++
#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 // CFIS_Main is my Mdi-Container
=========================================================
#any Include Reqd?????

C++
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;
}


From the above code I can't identify my mistake, Does anybody can point me?
Thanks For Helps
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900