Click here to Skip to main content
16,005,491 members
Home / Discussions / C#
   

C#

 
GeneralRe: Windows Messages Pin
Roman Rodov19-Apr-04 14:57
Roman Rodov19-Apr-04 14:57 
GeneralC# #define macro equivalent. Pin
HAHAHA_NEXT19-Apr-04 11:47
HAHAHA_NEXT19-Apr-04 11:47 
GeneralRe: C# #define macro equivalent. Pin
Mikko Puonti19-Apr-04 13:01
Mikko Puonti19-Apr-04 13:01 
GeneralRe: C# #define macro equivalent. Pin
HAHAHA_NEXT20-Apr-04 6:31
HAHAHA_NEXT20-Apr-04 6:31 
GeneralRe: C# #define macro equivalent. Pin
leppie20-Apr-04 7:05
leppie20-Apr-04 7:05 
GeneralRedraw scrollbars of TreeView Pin
Jean Bédard19-Apr-04 9:54
Jean Bédard19-Apr-04 9:54 
GeneralThreadPool Class Pin
Spiros19-Apr-04 8:58
Spiros19-Apr-04 8:58 
GeneralRe: ThreadPool Class Pin
Heath Stewart19-Apr-04 9:14
protectorHeath Stewart19-Apr-04 9:14 
That's what the state parameter is for. Since it's an object - and therefore a reference type - it can be used to pass both input and output arguments. If you want better handling of parameters and return values, use asynchronous methods instead (such as BeginWhatever and EndWhatever). If you use the proper signature for methods in C#, the compiler can actually create asynchronous methods for your methods. See Including Asynchronous Calls[^] in the .NET Framework SDK for more information.

Also, worker threads are common associated with an object that contains the data with which the callback method operates, so if it also stores state in such properties, you can always retrieve them later when the worker thread finishes, if it finishes at all (some are designed to run continuously - it's all up to your design).

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: ThreadPool Class Pin
dabuskol19-Apr-04 19:02
dabuskol19-Apr-04 19:02 
GeneralAPI (GetPrivateProfileString) does not understand extention. Pin
mcgahanfl19-Apr-04 8:57
mcgahanfl19-Apr-04 8:57 
Questionhow to add function to Explorer's context menu Pin
Paolo Ponzano19-Apr-04 8:40
Paolo Ponzano19-Apr-04 8:40 
AnswerRe: how to add function to Explorer's context menu Pin
Heath Stewart19-Apr-04 8:54
protectorHeath Stewart19-Apr-04 8:54 
AnswerRe: how to add function to Explorer's context menu Pin
Mike Dimmick19-Apr-04 8:55
Mike Dimmick19-Apr-04 8:55 
AnswerRe: how to add function to Explorer's context menu Pin
Heath Stewart19-Apr-04 8:57
protectorHeath Stewart19-Apr-04 8:57 
GeneralControl Arrays Pin
SanShou19-Apr-04 7:09
SanShou19-Apr-04 7:09 
GeneralRe: Control Arrays Pin
Heath Stewart19-Apr-04 8:50
protectorHeath Stewart19-Apr-04 8:50 
GeneralOpenfiledialog Pin
Appelz19-Apr-04 4:52
Appelz19-Apr-04 4:52 
GeneralRe: Openfiledialog Pin
Jon G19-Apr-04 4:54
Jon G19-Apr-04 4:54 
GeneralRe: Openfiledialog Pin
Heath Stewart19-Apr-04 5:06
protectorHeath Stewart19-Apr-04 5:06 
GeneralRe: Openfiledialog Pin
Heath Stewart19-Apr-04 5:05
protectorHeath Stewart19-Apr-04 5:05 
GeneralNeed help with crystal reports in C# Pin
AAQ19-Apr-04 4:51
AAQ19-Apr-04 4:51 
GeneralRe: Need help with crystal reports in C# Pin
Heath Stewart19-Apr-04 5:09
protectorHeath Stewart19-Apr-04 5:09 
GeneralRe: Need help with crystal reports in C# Pin
AAQ19-Apr-04 19:51
AAQ19-Apr-04 19:51 
GeneralRe: Need help with crystal reports in C# Pin
Heath Stewart20-Apr-04 3:29
protectorHeath Stewart20-Apr-04 3:29 
GeneralC# CF image processing Pin
icem4n19-Apr-04 4:36
icem4n19-Apr-04 4:36 

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.