G
Guest
Hi,
I successfully implement a static callback function for my dll usign
delegates. Now, I need to use member function instead of static function. How
can I make that (in Managed C++).
Hugo
// .h
typedef void (CALLBACK *FCallback)(); // From DLL
__delegate void CallBackDelegate();
public: static CallBackDelegate* pTheStaticDelegate;
// .cpp
Void Form1::button1_Click(System::Object * sender, System::EventArgs * e)
{
pTheStaticDelegate = new CallBackDelegate(GetType(),
&Form1::TheStaticCallback);
SetCallback((FCallback) TheStaticCallback); // From DLL
}
Void Form1::button2_Click(System::Object * sender, System::EventArgs * e)
{
UseCallback(); // From DLL
}
void Form1::TheStaticCallback()
{
System:iagnostics::Trace::WriteLine(S"In the static callback");
}
I successfully implement a static callback function for my dll usign
delegates. Now, I need to use member function instead of static function. How
can I make that (in Managed C++).
Hugo
// .h
typedef void (CALLBACK *FCallback)(); // From DLL
__delegate void CallBackDelegate();
public: static CallBackDelegate* pTheStaticDelegate;
// .cpp
Void Form1::button1_Click(System::Object * sender, System::EventArgs * e)
{
pTheStaticDelegate = new CallBackDelegate(GetType(),
&Form1::TheStaticCallback);
SetCallback((FCallback) TheStaticCallback); // From DLL
}
Void Form1::button2_Click(System::Object * sender, System::EventArgs * e)
{
UseCallback(); // From DLL
}
void Form1::TheStaticCallback()
{
System:iagnostics::Trace::WriteLine(S"In the static callback");
}