Courtesy of Doug Harrison (fellow VC++ MVP):

#using 
using namespace System;
public __delegate void Del();
__gc struct A
{
void f() {
Console::WriteLine(S"A::f()\nTypeIs: {0}", this->GetType());
}
};
__gc struct B
{
void f() {
Console::WriteLine(S"B::f()\nTypeIs: {0}", this->GetType());
}
};
int main()
{
Del* s = new Del(new B(), &A::f);
s();
}

Enjoy!


Tomas Restrepo

Software developer located in Colombia. Sr. PFE at Microsoft.