Click here to Skip to main content
16,021,757 members
Home / Discussions / C#
   

C#

 
GeneralRe: We are inviting you to hotdotnet. Pin
Uwe Keim11-Feb-04 1:43
sitebuilderUwe Keim11-Feb-04 1:43 
GeneralBinding array to combobox Pin
Anonymous10-Feb-04 20:05
Anonymous10-Feb-04 20:05 
QuestionPanel Control covering my other controls... IDE BUG? Pin
gordingin10-Feb-04 16:15
gordingin10-Feb-04 16:15 
AnswerRe: Panel Control covering my other controls... IDE BUG? Pin
Heath Stewart11-Feb-04 3:14
protectorHeath Stewart11-Feb-04 3:14 
GeneralC# communication with events Pin
MusicAlly10-Feb-04 14:45
MusicAlly10-Feb-04 14:45 
GeneralRe: C# communication with events Pin
Kentamanos10-Feb-04 15:35
Kentamanos10-Feb-04 15:35 
GeneralRe: C# communication with events Pin
MusicAlly10-Feb-04 16:54
MusicAlly10-Feb-04 16:54 
GeneralRe: C# communication with events Pin
Heath Stewart11-Feb-04 3:52
protectorHeath Stewart11-Feb-04 3:52 
A similar way is possible using an object-oriented framework like .NET. Instead of thinking procedurally, though, thing about how these objects react with each other, or with other objects.

For instance, you could code an event on the object that starts all the threads, for which they would handle. You should invoke these delegates attached to the event in an asynchronous manner, most likely. You could also add events to the threaded object but then the invoking class has to keep track of them and add and remove delegates. The first way makes more sense.

One thing that may help is that the C# compiler (I believe the VB.NET compilers does as well) generates synchronous (Invoke) and asynchronous invocation methods (BeginInvoke, EndInvoke). that are visible in the code editor when the delegates are declared in the current project. For more on asynchronous calls in .NET, see Including Asynchronous Calls[^] in the .NET Framework SDK.

It seem, though, like you are headed in the right direction. The only thing you have to watch out for is that you invoke the methods from the calling thread in the thread that contains the object.

 

Microsoft MVP, Visual C#
My Articles
GeneralCompiler Optimizations Pin
Andrew Shapira10-Feb-04 13:44
Andrew Shapira10-Feb-04 13:44 
GeneralVS-style colors Pin
Judah Gabriel Himango10-Feb-04 10:30
sponsorJudah Gabriel Himango10-Feb-04 10:30 
GeneralRe: VS-style colors Pin
Heath Stewart10-Feb-04 11:33
protectorHeath Stewart10-Feb-04 11:33 
GeneralRe: VS-style colors Pin
Uwe Keim11-Feb-04 1:47
sitebuilderUwe Keim11-Feb-04 1:47 
GeneralRe: VS-style colors Pin
Judah Gabriel Himango11-Feb-04 4:48
sponsorJudah Gabriel Himango11-Feb-04 4:48 
GeneralRe: VS-style colors Pin
Heath Stewart11-Feb-04 5:12
protectorHeath Stewart11-Feb-04 5:12 
GeneralProgrammatic mouse movement Pin
Darryl Borden10-Feb-04 10:29
Darryl Borden10-Feb-04 10:29 
GeneralRe: Programmatic mouse movement Pin
Judah Gabriel Himango10-Feb-04 10:33
sponsorJudah Gabriel Himango10-Feb-04 10:33 
GeneralDebugging into a reference Pin
gordingin10-Feb-04 10:23
gordingin10-Feb-04 10:23 
GeneralRe: Debugging into a reference Pin
Bill Dean10-Feb-04 10:29
Bill Dean10-Feb-04 10:29 
GeneralRe: Debugging into a reference Pin
gordingin10-Feb-04 10:34
gordingin10-Feb-04 10:34 
GeneralRe: Debugging into a reference Pin
Heath Stewart10-Feb-04 11:35
protectorHeath Stewart10-Feb-04 11:35 
GeneralRe: Debugging into a reference Pin
gordingin11-Feb-04 3:57
gordingin11-Feb-04 3:57 
Generalparallel port Pin
Member 87345210-Feb-04 7:51
Member 87345210-Feb-04 7:51 
GeneralRe: parallel port Pin
Marc Clifton10-Feb-04 8:39
mvaMarc Clifton10-Feb-04 8:39 
GeneralRe: parallel port Pin
Marc Clifton10-Feb-04 9:41
mvaMarc Clifton10-Feb-04 9:41 
GeneralBetter yet... Pin
Marc Clifton10-Feb-04 9:42
mvaMarc Clifton10-Feb-04 9:42 

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.