Click here to Skip to main content
15,914,014 members
Home / Discussions / C#
   

C#

 
QuestionHow do I find a file associated icon? Pin
Lars Fisker19-Aug-03 9:17
Lars Fisker19-Aug-03 9:17 
AnswerRe: How do I find a file associated icon? Pin
Heath Stewart19-Aug-03 9:46
protectorHeath Stewart19-Aug-03 9:46 
GeneralRe: How do I find a file associated icon? Pin
Lars Fisker19-Aug-03 10:48
Lars Fisker19-Aug-03 10:48 
QuestionTrapping the enter key? Pin
BoozeBomb19-Aug-03 8:57
BoozeBomb19-Aug-03 8:57 
AnswerRe: Trapping the enter key? Pin
Heath Stewart19-Aug-03 9:14
protectorHeath Stewart19-Aug-03 9:14 
GeneralRe: Trapping the enter key? Pin
BoozeBomb19-Aug-03 9:25
BoozeBomb19-Aug-03 9:25 
Generalasync delegates Pin
devvvy19-Aug-03 8:32
devvvy19-Aug-03 8:32 
GeneralRe: async delegates Pin
Heath Stewart19-Aug-03 9:26
protectorHeath Stewart19-Aug-03 9:26 
As the documentation states, the state can be anything you want to pass to the callback. This could be an array of Object, since every array is an Array and an Array inherits from Object (as everything in .NET does). I use a similar mechanism (my own delegates and callbacks, but same idea) to use generics while passing specifics to the callbacks. For instance, I provide a tree service that has many methods that all use the same "find node X" method that takes a callback and a state parameter. When the node is found, the callback is invoked and the state is passed as a parameter. The callback method uses the state to do the actual work. Each publicly exposed method needs to find a node in the same way, but the callback does something completely different and is specific to the exposed method - the state is data that is passed through from the exposed method to the callback method.

When talking of handles, it all comes down to threads. You could simply pass an EventArgs derivative because those are created in many threads - the handle that you wait on must be global, otherwise one thread won't sync with another thread. The WaitHandle is global to all threads and WaitOne merely waits for it to be signals. If you look at the documentation, WaitAll and WaitAny are actually static methods. You must pass an array of WaitHandle instances to them and they will wait appropriately. WaitOne can be an instance method because it just uses the global handle of the WaitHandle from which it's being called.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
Generalsending mail with attachments Pin
Sprinkle19-Aug-03 7:57
Sprinkle19-Aug-03 7:57 
GeneralRe: sending mail with attachments Pin
Heath Stewart19-Aug-03 9:53
protectorHeath Stewart19-Aug-03 9:53 
QuestionDetermining radio button choice...??? Pin
vlusardi19-Aug-03 7:33
vlusardi19-Aug-03 7:33 
AnswerRe: Determining radio button choice...??? Pin
Heath Stewart19-Aug-03 9:56
protectorHeath Stewart19-Aug-03 9:56 
GeneralGIS in C# Pin
laphijia19-Aug-03 7:07
laphijia19-Aug-03 7:07 
GeneralUsing ActiveX control in C# Pin
Big Trev19-Aug-03 6:43
Big Trev19-Aug-03 6:43 
GeneralRe: Using ActiveX control in C# Pin
Stephane Rodriguez.19-Aug-03 8:45
Stephane Rodriguez.19-Aug-03 8:45 
GeneralRe: Using ActiveX control in C# Pin
Heath Stewart19-Aug-03 10:03
protectorHeath Stewart19-Aug-03 10:03 
GeneralRe: Using ActiveX control in C# Pin
Big Trev19-Aug-03 21:32
Big Trev19-Aug-03 21:32 
GeneralRe: Using ActiveX control in C# Pin
Heath Stewart20-Aug-03 2:26
protectorHeath Stewart20-Aug-03 2:26 
GeneralRe: Using ActiveX control in C# Pin
Big Trev20-Aug-03 2:44
Big Trev20-Aug-03 2:44 
GeneralMicrosoft Word automation Pin
Radoslav Bielik19-Aug-03 6:35
Radoslav Bielik19-Aug-03 6:35 
GeneralRe: Microsoft Word automation Pin
Stephane Rodriguez.19-Aug-03 6:42
Stephane Rodriguez.19-Aug-03 6:42 
GeneralRe: Microsoft Word automation Pin
Radoslav Bielik19-Aug-03 7:16
Radoslav Bielik19-Aug-03 7:16 
GeneralAdd a progressbar to a statusbar... Pin
BoozeBomb19-Aug-03 4:18
BoozeBomb19-Aug-03 4:18 
GeneralRe: Add a progressbar to a statusbar... Pin
Heath Stewart19-Aug-03 10:04
protectorHeath Stewart19-Aug-03 10:04 
Questionany "smarter" to convert char[] to byte[]? Pin
zecodela19-Aug-03 0:32
zecodela19-Aug-03 0:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.