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

C#

 
GeneralInsert Help Pin
GaMBiT_KC7-Mar-05 21:06
GaMBiT_KC7-Mar-05 21:06 
GeneralRe: Insert Help Pin
Kodanda Pani7-Mar-05 22:17
Kodanda Pani7-Mar-05 22:17 
GeneralRe: Insert Help Pin
GaMBiT_KC8-Mar-05 0:19
GaMBiT_KC8-Mar-05 0:19 
GeneralMultithreading and Appdomain Pin
joshi_vipul7-Mar-05 18:39
joshi_vipul7-Mar-05 18:39 
GeneralRe: Multithreading and Appdomain Pin
Robert Rohde7-Mar-05 19:28
Robert Rohde7-Mar-05 19:28 
GeneralRe: Multithreading and Appdomain Pin
7-Mar-05 19:47
suss7-Mar-05 19:47 
GeneralRe: Multithreading and Appdomain Pin
J4amieC7-Mar-05 22:11
J4amieC7-Mar-05 22:11 
GeneralRe: Multithreading and Appdomain Pin
LongRange.Shooter8-Mar-05 2:42
LongRange.Shooter8-Mar-05 2:42 
using System.Threading;<br />
namespace mynamespace     
< when this executes it is in an app domain
<br />
{<br />
    public class myClass:Forms<br />
    {<br />
    ...<br />
    Thread computationalThread;<br />
    MyCompute computational = new MyCompute();<br />
    computational.DoneEvent+= new DoneEventHandler(newValue);<br />
    compuationalThread = new Thread(computational.ComputeData);<br />
    compuationalThread.Start(); 
< now I begin an independant thread in my app domain
<br />
    ...<br />
    //send data to the compuational thread<br />
    public void button_press(sender, eventargs)<br />
    {<br />
      computational.ValueOne = myForm.Data.Text;<br />
      computational.ValueTwo = myForm.DataTwo.Text;<br />
      return;<br />
    }<br />
    // get the results when the computational thread lets me know it is done<br />
    public void newValue(..)<br />
    {<br />
         myForm.DataResult.Text = computational.Result;<br />
         return;<br />
    }<br />
<br />


Notice that everything in this case is running inside a single app domain. Inside that domain I have 2 threads that I created. (the system probably creates tons) My computational thread runs independantly but due to the limits of Windows form processing I cannot update the screen!!! So it raises an event -- the event enters the message pump -- and my application updates the screen. The window continues to react to all other events during that calculation such as paintovers, mouse moves, mouse clicks, etc.
Go to MSDN and read the tutorials on multi-threading. It really helps to get a handle on things.

There are 10 kinds of people in the world.

Those that read binary...

...and those who don't.

GeneralDelete in Textbox Pin
chettu7-Mar-05 16:47
chettu7-Mar-05 16:47 
GeneralRe: Delete in Textbox Pin
Yulianto.7-Mar-05 19:47
Yulianto.7-Mar-05 19:47 
GeneralRe: Delete in Textbox Pin
chettu7-Mar-05 20:28
chettu7-Mar-05 20:28 
GeneralRe: Delete in Textbox Pin
Yulianto.7-Mar-05 21:00
Yulianto.7-Mar-05 21:00 
GeneralSystem.Net.WebException: The underlying connection was closed Pin
Liu Shuai7-Mar-05 10:42
Liu Shuai7-Mar-05 10:42 
GeneralTray Application Pin
kaka227-Mar-05 10:11
kaka227-Mar-05 10:11 
GeneralRe: Tray Application Pin
Liu Shuai7-Mar-05 10:31
Liu Shuai7-Mar-05 10:31 
GeneralRe: Tray Application Pin
bneacetp7-Mar-05 17:07
bneacetp7-Mar-05 17:07 
GeneralUsing Marshal Pin
gmhanna7-Mar-05 7:51
gmhanna7-Mar-05 7:51 
GeneralRe: Using Marshal Pin
Mathew Hall7-Mar-05 21:41
Mathew Hall7-Mar-05 21:41 
Generalcallback to c++ Pin
reuvenkupfer7-Mar-05 7:41
reuvenkupfer7-Mar-05 7:41 
GeneralAdding worksheets to Excelfiles Pin
zaubara7-Mar-05 6:50
zaubara7-Mar-05 6:50 
Questionhow to check if workstation is locked/logged off Pin
Rene_Steen7-Mar-05 6:15
Rene_Steen7-Mar-05 6:15 
GeneralPrinting HTML Files programmatically Pin
BrettMostert7-Mar-05 6:05
BrettMostert7-Mar-05 6:05 
GeneralExplorer Band Objects and the DOM Pin
Dustin Lyday7-Mar-05 5:43
Dustin Lyday7-Mar-05 5:43 
GeneralLooping through listbox selections in Windows Pin
scotlandc7-Mar-05 5:36
scotlandc7-Mar-05 5:36 
GeneralC# CAS question Pin
elapid7-Mar-05 4:43
elapid7-Mar-05 4:43 

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.