The functionality you're looking for is supported by delegates. A
delegate contains a reference to a function (see MSDN.)
Once you have the delegate set up, you can call BeginInvoke() to start
an asynchronous call. If you don't specify a callback function, you can
just forget about it from that point and continue with other things.
Greetings,
Wessel> Once you have the delegate set up, you can call BeginInvoke() to start
> an asynchronous call. If you don't specify a callback function, you
> can just forget about it from that point and continue with other
> things.
Actually, you do need to worry about it after you call BeginInvoke regardless
of wether you want a return value. IOW, you must call EndInvoke (this can
be done from a callback function, so it's not so bad). The docs state that
the runtime reserves the right to leak resources if you fail to call EndInvoke.
This documentation was added in v1.1, so people who wrote in v1.0 weren't
aware of this issue.
-Brock
DevelopMentor
http://staff.develop.com/ballen
0 comments:
Post a Comment