Create delegate from MethodInfo

  • Thread starter Thread starter Stan Huff
  • Start date Start date
S

Stan Huff

How do instantiate a delegate given a MethodInfo and possibly and object
instance (for non-static methods)? My delegates only take a function
pointer in the constructor.

Thanks,
Stan
 
Does Delegate.CreateDelegate give you what you need? You don't say how much you know about the delegate type you want or the target object type.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

How do instantiate a delegate given a MethodInfo and possibly and object
instance (for non-static methods)? My delegates only take a function
pointer in the constructor.

Thanks,
Stan
 
That is just what I was looking for!

Thanks,

Stan


Richard Blewett said:
Does Delegate.CreateDelegate give you what you need? You don't say how
much you know about the delegate type you want or the target object type.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top