Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
CCR Programming - Jeffrey Richter and George Chrysanthakopoulos
Sep 19, 2006 at 1:48 PMI have basically two questions concerning CCR.
1. How can I cancel pending ReceiverTasks? Let's say that I have created some permanent Receivers and wired them up with some Port. Finally, I've posted some 1000 items to that port. I have the Cancel button on my form and now I want to cancel all pending tasks. Should I use another DispatcherQueue to preempt existing queued tasks? How can I do that?
2. I am playing with the WinFormsAdaptor and WinFormsServicePort. Inside my main method I wrote following:
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Dispatcher dispatcher = new Dispatcher(0, "CCRDemo Threads");
DispatcherQueue dispatcherQueue = new
DispatcherQueue("CCRDemo DispatcherQueue", dispatcher);
WinFormsServicePort port =
WinFormsAdaptor.Create(dispatcherQueue);
port.Post(new RunForm(new WinFormConstructor(delegate
{
return new MainForm(dispatcherQueue);
})));
}
MainForm displays properly and everything looks nice until I push close button on my form. Form closes but application hangs i.e. WinFormsUIThread running hidden form doesn't stop. What should I do to properly shutdown the app?
BTW, I haven't slept properly lately because of the CCR
ok