V
vcquestions
Hi.
Is there way to have a function pointer to a delegate in c++/cli that
would allow me to pass delegates with the same signatures as
parameters to a method?
I'm working with managed code. Let's say we have 2 delegates:
public delegate void FirstDelegate( int i );
public delegate void SecondDelegate( int i );
classA::method1( )
{
int i = 1;
doSomething( );
m_obj->FirstDelegate( i );
}
class A::method2( )
{
doSomething( );
int j = 2;
m_obj->SecondDelegate( j );
}
Is there a way to have a function pointer to a delegate so that I can
just have a common function that would take the delegate as a
parameter:
class A::methodInsteadOf1And2( delegateFunctionPointer )
{
int i = 3;
m_obj->delegateFunctionPointer( i );
}
thanks,
vcq
Is there way to have a function pointer to a delegate in c++/cli that
would allow me to pass delegates with the same signatures as
parameters to a method?
I'm working with managed code. Let's say we have 2 delegates:
public delegate void FirstDelegate( int i );
public delegate void SecondDelegate( int i );
classA::method1( )
{
int i = 1;
doSomething( );
m_obj->FirstDelegate( i );
}
class A::method2( )
{
doSomething( );
int j = 2;
m_obj->SecondDelegate( j );
}
Is there a way to have a function pointer to a delegate so that I can
just have a common function that would take the delegate as a
parameter:
class A::methodInsteadOf1And2( delegateFunctionPointer )
{
int i = 3;
m_obj->delegateFunctionPointer( i );
}
thanks,
vcq