A
Asfar
Here is my problem:
In file form1.h I have the following code:
#pragma once
#include "Test.h"
namespace AccessCheck
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:ata;
using namespace System:rawing;
public delegate void UpdateStatusEventHandler(String^);
public ref class Form1 : public System::Windows::Forms::Form
{
static event UpdateStatusEventHandler ^E;
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
E += gcnew UpdateStatusEventHandler(this,
&Form1::OnUpdateStatus);
}
public:
System::Void OnUpdateStatus(String ^str)
{
MessageBox::Show(str);
}
private:
System::Void button1_Click(System::Object^ sender,
System::EventArgs^ e)
{
Test ^test = gcnew Test();
test->FireEvents();
}
};
}
In the File Test1.h I have the following code:
#pragma once
using namespace System;
namespace AccessCheck
{
ref class Test
{
public:
Test(void)
{
}
public:
void FireEvents()
{
// I want to call OnUpdateStatus in Form1.h
}
};
}
In the funtion FireEvents() I want to do some processing and based on the
processing state I want to call UpdateStatusEventHandler. Any Idea on how to
do this.
Thanks,
-Asfar
In file form1.h I have the following code:
#pragma once
#include "Test.h"
namespace AccessCheck
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:ata;
using namespace System:rawing;
public delegate void UpdateStatusEventHandler(String^);
public ref class Form1 : public System::Windows::Forms::Form
{
static event UpdateStatusEventHandler ^E;
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
E += gcnew UpdateStatusEventHandler(this,
&Form1::OnUpdateStatus);
}
public:
System::Void OnUpdateStatus(String ^str)
{
MessageBox::Show(str);
}
private:
System::Void button1_Click(System::Object^ sender,
System::EventArgs^ e)
{
Test ^test = gcnew Test();
test->FireEvents();
}
};
}
In the File Test1.h I have the following code:
#pragma once
using namespace System;
namespace AccessCheck
{
ref class Test
{
public:
Test(void)
{
}
public:
void FireEvents()
{
// I want to call OnUpdateStatus in Form1.h
}
};
}
In the funtion FireEvents() I want to do some processing and based on the
processing state I want to call UpdateStatusEventHandler. Any Idea on how to
do this.
Thanks,
-Asfar