|
-
Mar 1st, 2011, 03:06 PM
#1
Thread Starter
Fanatic Member
BeginInvoke and Invoke
Microsoft have done it again. I simply want to find documentation about invoke and begininvoke. A member of delegates.
Guess what, simply searching on it on bing and stuff don't show anything. It shows control.invoke, etc.
In the delegate msdn entry there is no invoke member. At least not when I look for system.action or system.func.
Where can I found begininvoke documentation? what will happen if I put nothing as callback function for example? Intuitively the program simply don't call any call back function but hei, I want to makes ure of it.
-
Mar 1st, 2011, 09:57 PM
#2
Re: BeginInvoke and Invoke
The reason that there is no documentation for those methods is that they don't exist as part of the .NET Framework. They are emitted dynamically by the compiler. I didn't know this myself but it took me about 5 minutes of searching on MSDN to find out. After a few failed searches and the use of F1 in the IDE, I searched MSDN online for delegate begininvoke. This was the first result:
http://msdn.microsoft.com/en-us/libr...8VS.71%29.aspx
After clicking a few links I was here:
http://msdn.microsoft.com/en-us/library/22t547yb.aspx
That doesn't answer your question explicitly but it does do so implicitly:
If a callback method has been specified in the call to the BeginInvoke method, the callback method is called when the target method ends.
That implies that it is quite legal to not specify a callback method.
-
Mar 1st, 2011, 11:44 PM
#3
Thread Starter
Fanatic Member
Re: BeginInvoke and Invoke
I see. I also realized that unlike the regular usage of system.threading.thread, there is no way you do not want to specify the callback method. There is no other way to know whether the thread has ended or not.
If w
-
Mar 2nd, 2011, 12:27 AM
#4
Re: BeginInvoke and Invoke
There certainly is reason not to specify a callback method. Sometimes you need to do something when the asynchronous operation completes and sometimes you don't. If you do then you need a callback to do it. If you don't then you don't need a callback.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|