R
Reza
Hello,
I need to have 4-5 forms in my application.
The problem is that i use the Framework editor and when i create a form
there i get new .h/.cpp files.
So i can have a main form(first form created called TestForm) and many other
forms which i can access from main form but i can not access my Main Form
from the other forms
because if i include the MainForm in the other forms i think it cause a
circular
dependency and it shows me some error messages.
My code looks like this: (read the comments in code)
Note: Using only 2 forms here
---------------------------------------
==TestForm==
#include "Inquiry.h"
#include "Search.h"
namespace TestForm
{
using namespace System;
........
using namespace System:rawing;
using namespace InquiryForm; //Other Form
using namespace SearchForm; //Other Form
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Inquiry* pInquiry ; //I can access my other form by creating a object from
thoese classes here <<<<
Form1(void)
{
InitializeComponent();
pInquiry = new Inquiry();
}
.........
---------------------------------------------
==InquiryForm==
//#include "Form1.h" //Need to include this in order to access my
TestForm or is there other ways? <<<
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:ata;
using namespace System:rawing;
//using namespace TestForm; //Need to include this in order to access my
TestForm or is there other ways? <<<<<<
namespace InquiryForm
{
public __gc class Inquiry : public System::Windows::Forms::Form
{
public:
Form* m_pMain;
Inquiry(void)
{
InitializeComponent();
m_pMain = new Form1();
}
.......
Please give me some hints
Thanks
/Reza
I need to have 4-5 forms in my application.
The problem is that i use the Framework editor and when i create a form
there i get new .h/.cpp files.
So i can have a main form(first form created called TestForm) and many other
forms which i can access from main form but i can not access my Main Form
from the other forms
because if i include the MainForm in the other forms i think it cause a
circular
dependency and it shows me some error messages.
My code looks like this: (read the comments in code)
Note: Using only 2 forms here
---------------------------------------
==TestForm==
#include "Inquiry.h"
#include "Search.h"
namespace TestForm
{
using namespace System;
........
using namespace System:rawing;
using namespace InquiryForm; //Other Form
using namespace SearchForm; //Other Form
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Inquiry* pInquiry ; //I can access my other form by creating a object from
thoese classes here <<<<
Form1(void)
{
InitializeComponent();
pInquiry = new Inquiry();
}
.........
---------------------------------------------
==InquiryForm==
//#include "Form1.h" //Need to include this in order to access my
TestForm or is there other ways? <<<
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:ata;
using namespace System:rawing;
//using namespace TestForm; //Need to include this in order to access my
TestForm or is there other ways? <<<<<<
namespace InquiryForm
{
public __gc class Inquiry : public System::Windows::Forms::Form
{
public:
Form* m_pMain;
Inquiry(void)
{
InitializeComponent();
m_pMain = new Form1();
}
.......
Please give me some hints
Thanks
/Reza