Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / December 2003

Tip: Looking for answers? Try searching our database.

Create a delegate from MethodInfo

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Scott - 15 Nov 2003 10:43 GMT
Hi

I'm using the Compact Framework and I want to create an instance of a
delegate from a MethodInfo but Delegate.CreateDelegate() isn't supported on
the CF.

So can anyone tell me how to do this "long hand" in C#. I'm using a custom
attribute to mark methods that I want to call at runtime. I want to create a
delegate to these methods and I can easily get a MethodInfo for them. But
the last step of creating the delegate eludes me. It can't be hard, surely,
as a delegate is a very simple object.

Any ideas?

Cheers,

MikeS.
xor - 07 Dec 2003 04:22 GMT
To call a method dynamiclly at runtime, you can use MethodInfo.Invoke()

"Mike Scott" <mike@nospam.com> ????????????
:#9nkcV2qDHA.1656@tk2msftngp13.phx.gbl...
> Hi
[quoted text clipped - 14 lines]
>
> MikeS.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.