Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
QuestionToolstripLabel rendering Pin
Ravi Bhavnani21-Feb-06 7:14
professionalRavi Bhavnani21-Feb-06 7:14 
QuestionGetting the Serial Key Pin
superPaul10121-Feb-06 7:10
superPaul10121-Feb-06 7:10 
QuestionHow to register ActiveX contorl Pin
papa198021-Feb-06 6:10
papa198021-Feb-06 6:10 
QuestionExtracting information from URLs Pin
hasanali0021-Feb-06 6:09
hasanali0021-Feb-06 6:09 
AnswerRe: Extracting information from URLs Pin
Wjousts21-Feb-06 8:08
Wjousts21-Feb-06 8:08 
QuestionAdd IMessageFilter to COM Pin
jerryyag21-Feb-06 5:42
jerryyag21-Feb-06 5:42 
QuestionHow do I create a videoplayer? Pin
ChevyVanDude21-Feb-06 5:02
ChevyVanDude21-Feb-06 5:02 
QuestionMultithreading problem Pin
Le centriste21-Feb-06 4:50
Le centriste21-Feb-06 4:50 
I have a strange problem. Here is what I try to achieve:

Have a background thread performing work, and sending events so the form can update controls as work progresses. To do this, i use Delegate.BeginInvoke and its companion Delegate.EndInvoke.

This works very well, except when I added another event (still works for other events, though). This event is special as the it inform the Form that an exception has occured. This event has information to display to the user as how to fix the problem.

The EventArgs has a member similar to CancelEventArgs, to tell the event raiser whether the execution of the task should be retried or cancelled. To achieve this, the event handler displays a dialog box asking the user to fix the problem. This form has buttons to ask the user if the problem is fixed or not, thus indicating the worker thread to retry or not.

I have tried to display the secondary for to the user using 2 ways (none worked):

1- Calling Form.ShowDialog directly from the event handler.
2- Calling Form.Invoke from the event handler to have the secondary form instantiated on the same thread as the form one.

None work, the code stops at the Showdialog call, the form never appears, and the worker thread finishes at the event raising line (Delegate.EndInvoke is called).

--------

"I say no to drugs, but they don't listen."
- Marilyn Manson
AnswerRe: Multithreading problem Pin
Alvaro Mendez21-Feb-06 6:14
Alvaro Mendez21-Feb-06 6:14 
AnswerRe: Multithreading problem Pin
Judah Gabriel Himango21-Feb-06 6:21
sponsorJudah Gabriel Himango21-Feb-06 6:21 
GeneralRe: Multithreading problem Pin
Le centriste21-Feb-06 6:35
Le centriste21-Feb-06 6:35 
GeneralRe: Multithreading problem Pin
Judah Gabriel Himango21-Feb-06 6:56
sponsorJudah Gabriel Himango21-Feb-06 6:56 
GeneralRe: Multithreading problem Pin
Le centriste21-Feb-06 7:10
Le centriste21-Feb-06 7:10 
AnswerSOLVED (Unrelated to multithreading) Pin
Le centriste21-Feb-06 7:11
Le centriste21-Feb-06 7:11 
QuestionArray of pointers/references to another array Pin
naveed21-Feb-06 4:35
naveed21-Feb-06 4:35 
AnswerRe: Array of pointers/references to another array Pin
Le centriste21-Feb-06 4:53
Le centriste21-Feb-06 4:53 
GeneralRe: Array of pointers/references to another array Pin
naveed21-Feb-06 5:06
naveed21-Feb-06 5:06 
GeneralRe: Array of pointers/references to another array Pin
Le centriste21-Feb-06 5:10
Le centriste21-Feb-06 5:10 
GeneralRe: Array of pointers/references to another array Pin
naveed21-Feb-06 6:46
naveed21-Feb-06 6:46 
QuestionWindows Form from Outlook Pin
tanishq151021-Feb-06 4:29
tanishq151021-Feb-06 4:29 
QuestionCustom textbox with dropdownlist behavior Pin
hansdredd21-Feb-06 4:28
hansdredd21-Feb-06 4:28 
AnswerRe: Custom textbox with dropdownlist behavior Pin
hooray21-Feb-06 5:18
hooray21-Feb-06 5:18 
GeneralRe: Custom textbox with dropdownlist behavior Pin
hansdredd21-Feb-06 20:25
hansdredd21-Feb-06 20:25 
GeneralRe: Custom textbox with dropdownlist behavior Pin
Roy Heil22-Feb-06 7:46
professionalRoy Heil22-Feb-06 7:46 
GeneralRe: Custom textbox with dropdownlist behavior Pin
hansdredd23-Feb-06 20:52
hansdredd23-Feb-06 20:52 

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.