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

C#

 
GeneralRe: Disposing of objects Pin
Gareth H28-Dec-07 4:09
Gareth H28-Dec-07 4:09 
GeneralRe: Disposing of objects Pin
Colin Angus Mackay28-Dec-07 4:14
Colin Angus Mackay28-Dec-07 4:14 
GeneralRe: Disposing of objects Pin
Not Active28-Dec-07 6:18
mentorNot Active28-Dec-07 6:18 
GeneralRe: Disposing of objects Pin
Paul Conrad28-Dec-07 7:00
professionalPaul Conrad28-Dec-07 7:00 
GeneralRe: Disposing of objects Pin
GuyThiebaut28-Dec-07 3:38
professionalGuyThiebaut28-Dec-07 3:38 
GeneralRe: Disposing of objects Pin
Luc Pattyn28-Dec-07 3:57
sitebuilderLuc Pattyn28-Dec-07 3:57 
GeneralRe: Disposing of objects Pin
Gareth H28-Dec-07 4:10
Gareth H28-Dec-07 4:10 
QuestionExceptions and Backgroundworker Pin
boersnoes28-Dec-07 2:43
boersnoes28-Dec-07 2:43 
By doing the following

BackgroundWorker syncWorker = new BackgroundWorker();<br />
syncWorker.DoWork += new DoWorkEventHandler(SynchronizeDir);<br />
syncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(Synchronized);<br />
syncWorker.RunWorkerAsync(new Object[] { fromDir, toDir, filter, createRemotePath });<br />
Synchronized(syncWorker, new RunWorkerCompletedEventArgs(null, err, true));


A backgroundworker is spawned from the GUI thread into a new thread.
Is there a way to catch any errors that don't get handled by the new thread, in the GUI thread?

Google tells me the RunWorkerCompletedEventhandler (Synchronized in this case) should normally be fired and its RunWorkerCompletedEventArgs should contain the exception in the .Error field.
Rethrowing the error in the spawned thread doesn't get the exception through to the GUI thread.
Even plain ignoring the exception gives me an .Error field with null as value.

What am I doing wrong?
GeneralRe: Exceptions and Backgroundworker Pin
KaptinKrunch28-Dec-07 4:26
KaptinKrunch28-Dec-07 4:26 
GeneralRe: Exceptions and Backgroundworker Pin
boersnoes28-Dec-07 5:23
boersnoes28-Dec-07 5:23 
GeneralRe: Exceptions and Backgroundworker Pin
KaptinKrunch28-Dec-07 5:52
KaptinKrunch28-Dec-07 5:52 
GeneralRe: Exceptions and Backgroundworker Pin
boersnoes30-Dec-07 22:07
boersnoes30-Dec-07 22:07 
Generaltags Pin
Luc Pattyn28-Dec-07 5:56
sitebuilderLuc Pattyn28-Dec-07 5:56 
GeneralRe: tags Pin
boersnoes30-Dec-07 22:08
boersnoes30-Dec-07 22:08 
GeneralRowfilter Pin
topcatalpha28-Dec-07 2:22
topcatalpha28-Dec-07 2:22 
GeneralRe: Rowfilter Pin
KaptinKrunch28-Dec-07 3:51
KaptinKrunch28-Dec-07 3:51 
GeneralRe: Rowfilter Pin
topcatalpha1-Jan-08 20:44
topcatalpha1-Jan-08 20:44 
GeneralError:Unsafe code may only appear if compiling with /unsafe Pin
zeeShan anSari28-Dec-07 1:59
zeeShan anSari28-Dec-07 1:59 
GeneralRe: Error:Unsafe code may only appear if compiling with /unsafe Pin
boersnoes28-Dec-07 2:47
boersnoes28-Dec-07 2:47 
GeneralRe: Error:Unsafe code may only appear if compiling with /unsafe Pin
Luc Pattyn28-Dec-07 3:58
sitebuilderLuc Pattyn28-Dec-07 3:58 
Questionhow to get a view on a vector Pin
edaw28-Dec-07 0:32
edaw28-Dec-07 0:32 
GeneralRe: how to get a view on a vector Pin
Colin Angus Mackay28-Dec-07 1:10
Colin Angus Mackay28-Dec-07 1:10 
GeneralRe: how to get a view on a vector Pin
edaw28-Dec-07 1:41
edaw28-Dec-07 1:41 
GeneralRe: how to get a view on a vector Pin
Luc Pattyn28-Dec-07 4:03
sitebuilderLuc Pattyn28-Dec-07 4:03 
GeneralRe: how to get a view on a vector Pin
edaw28-Dec-07 4:18
edaw28-Dec-07 4:18 

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.