Click here to Skip to main content
15,887,683 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reusable Toolbox Images Pin
dirkhelmet21-Jul-05 4:16
dirkhelmet21-Jul-05 4:16 
GeneralRe: Reusable Toolbox Images Pin
LongRange.Shooter21-Jul-05 4:26
LongRange.Shooter21-Jul-05 4:26 
GeneralIcon in ListView item Pin
george ivanov21-Jul-05 2:41
george ivanov21-Jul-05 2:41 
GeneralRe: Icon in ListView item Pin
Alomgir Miah21-Jul-05 3:33
Alomgir Miah21-Jul-05 3:33 
GeneralCheck If the software already running Pin
kevin_smoke21-Jul-05 1:26
kevin_smoke21-Jul-05 1:26 
GeneralRe: Check If the software already running Pin
Vasudevan Deepak Kumar21-Jul-05 2:36
Vasudevan Deepak Kumar21-Jul-05 2:36 
GeneralThread Abort Pin
Blue_Skye21-Jul-05 1:22
Blue_Skye21-Jul-05 1:22 
GeneralRe: Thread Abort Pin
LongRange.Shooter21-Jul-05 4:11
LongRange.Shooter21-Jul-05 4:11 
Here is one way of stopping your thread, making sure your current execution ends and you do not get an AbortException. You would have something like this to establish the thread in your main processor:

C#
ThreadClass function = new ThreadClass();  // your process
myThread = new ThreadStart(function.Process);



your Process would be something like this:
C#
public bool ThreadWanted = true;
... init/constructor logic ...
do
{
   if (  ..no data to process.. )
       Thread.Sleep(50);
   ...function
}
while (ThreadWanted)
return;


when you want the thread to abort just do this in the thread creator logic:
C#
public void TerminateProcess()
{
  function.ThreadWanted = false;
}


There are 10 kinds of people in the world.

Those that read binary...

...and those who don't.

GeneralRe: Thread Abort Pin
Blue_Skye21-Jul-05 6:29
Blue_Skye21-Jul-05 6:29 
GeneralRe: Thread Abort Pin
S. Senthil Kumar21-Jul-05 6:37
S. Senthil Kumar21-Jul-05 6:37 
GeneralAbout threading Pin
Rassul Yunussov21-Jul-05 1:20
Rassul Yunussov21-Jul-05 1:20 
GeneralRe: About threading Pin
LongRange.Shooter21-Jul-05 4:17
LongRange.Shooter21-Jul-05 4:17 
GeneralRe: About threading Pin
Rassul Yunussov21-Jul-05 19:27
Rassul Yunussov21-Jul-05 19:27 
GeneralRe: About threading Pin
LongRange.Shooter22-Jul-05 5:02
LongRange.Shooter22-Jul-05 5:02 
GeneralRe: About threading Pin
Rassul Yunussov21-Jul-05 19:46
Rassul Yunussov21-Jul-05 19:46 
GeneralRe: About threading Pin
Rassul Yunussov21-Jul-05 21:48
Rassul Yunussov21-Jul-05 21:48 
GeneralCreating a Gif file Pin
djing198520-Jul-05 23:34
djing198520-Jul-05 23:34 
GeneralRe: Creating a Gif file Pin
Libor Tinka21-Jul-05 0:05
Libor Tinka21-Jul-05 0:05 
GeneralRe: Creating a Gif file Pin
djing198521-Jul-05 0:33
djing198521-Jul-05 0:33 
GeneralRe: Creating a Gif file Pin
Yoyosh21-Jul-05 1:59
Yoyosh21-Jul-05 1:59 
GeneralRe: Creating a Gif file Pin
poucin10021-Jul-05 2:03
poucin10021-Jul-05 2:03 
GeneralRe: Creating a Gif file Pin
djing198521-Jul-05 4:25
djing198521-Jul-05 4:25 
GeneralIL code security Pin
Libor Tinka20-Jul-05 23:03
Libor Tinka20-Jul-05 23:03 
GeneralRe: IL code security Pin
Corinna John20-Jul-05 23:38
Corinna John20-Jul-05 23:38 
GeneralRe: IL code security Pin
Libor Tinka21-Jul-05 0:00
Libor Tinka21-Jul-05 0:00 

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.