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

C#

 
GeneralRe: Cancel = operator on collection Pin
NaNg1524113-Jun-06 8:10
NaNg1524113-Jun-06 8:10 
QuestionDelegates throwing Null Exception Pin
acezrwild81713-Jun-06 7:28
acezrwild81713-Jun-06 7:28 
AnswerRe: Delegates throwing Null Exception Pin
gantww13-Jun-06 7:39
gantww13-Jun-06 7:39 
GeneralRe: Delegates throwing Null Exception Pin
acezrwild81713-Jun-06 7:58
acezrwild81713-Jun-06 7:58 
GeneralRe: Delegates throwing Null Exception Pin
gantww13-Jun-06 8:14
gantww13-Jun-06 8:14 
GeneralRe: Delegates throwing Null Exception Pin
Dustin Metzgar13-Jun-06 8:17
Dustin Metzgar13-Jun-06 8:17 
GeneralRe: Delegates throwing Null Exception Pin
acezrwild81713-Jun-06 8:27
acezrwild81713-Jun-06 8:27 
GeneralRe: Delegates throwing Null Exception Pin
gantww13-Jun-06 8:40
gantww13-Jun-06 8:40 
Right. I should have passed the following in:

this.Invoke(new ProcessingCompleteDelegate(this.Search_ProcessingComplete));

The whole point of the Invoke... methods on the form object is not just to call a delegate, but to actually switch to the thread on which the form is running. Windows Forms are inherently single threaded due to their message loop. This is just a way to get them to run the code in question on the same thread as their message loop, instead of on the background thread. In the above example, I'm calling Invoke to get it to switch over to the UI thread and re-enter the method in that context.
GeneralRe: Delegates throwing Null Exception Pin
Dustin Metzgar13-Jun-06 8:41
Dustin Metzgar13-Jun-06 8:41 
GeneralRe: Delegates throwing Null Exception Pin
gantww13-Jun-06 8:42
gantww13-Jun-06 8:42 
GeneralRe: Delegates throwing Null Exception Pin
acezrwild81713-Jun-06 9:07
acezrwild81713-Jun-06 9:07 
GeneralRe: Delegates throwing Null Exception Pin
Dustin Metzgar13-Jun-06 9:20
Dustin Metzgar13-Jun-06 9:20 
GeneralRe: Delegates throwing Null Exception Pin
acezrwild81713-Jun-06 10:09
acezrwild81713-Jun-06 10:09 
GeneralRe: Delegates throwing Null Exception Pin
Dustin Metzgar13-Jun-06 10:21
Dustin Metzgar13-Jun-06 10:21 
GeneralRe: Delegates throwing Null Exception Pin
acezrwild81713-Jun-06 14:19
acezrwild81713-Jun-06 14:19 
GeneralRe: Delegates throwing Null Exception Pin
acezrwild81713-Jun-06 14:25
acezrwild81713-Jun-06 14:25 
GeneralRe: Delegates throwing Null Exception Pin
gantww14-Jun-06 3:17
gantww14-Jun-06 3:17 
GeneralRe: Delegates throwing Null Exception Pin
acezrwild81714-Jun-06 8:14
acezrwild81714-Jun-06 8:14 
GeneralRe: Delegates throwing Null Exception Pin
acezrwild81713-Jun-06 8:53
acezrwild81713-Jun-06 8:53 
GeneralRe: Delegates throwing Null Exception Pin
Judah Gabriel Himango13-Jun-06 9:39
sponsorJudah Gabriel Himango13-Jun-06 9:39 
GeneralRe: Delegates throwing Null Exception Pin
Dustin Metzgar13-Jun-06 10:15
Dustin Metzgar13-Jun-06 10:15 
GeneralRe: Delegates throwing Null Exception Pin
Judah Gabriel Himango13-Jun-06 12:50
sponsorJudah Gabriel Himango13-Jun-06 12:50 
GeneralRe: Delegates throwing Null Exception Pin
Dustin Metzgar13-Jun-06 15:31
Dustin Metzgar13-Jun-06 15:31 
AnswerRe: Delegates throwing Null Exception Pin
Dustin Metzgar13-Jun-06 7:43
Dustin Metzgar13-Jun-06 7:43 
GeneralRe: Delegates throwing Null Exception Pin
gantww13-Jun-06 7:49
gantww13-Jun-06 7:49 

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.