Hi,
I know that there is a method isalive to know if a thread is alive in the
framework.
But how do i know if a thread is alive and running in compact framework.

Is there any similar method in .net cf.....??

Thanks in Advance,
Murthy

RE: How to Know is a thread is alive by JoshChang

JoshChang
Mon May 21 05:27:00 CDT 2007

Hi Murthy,

Although it's a workaround by importing win32_CE API,
it's indeed a workable code segment....

Assume you use C#

using System.Threading;
using System.Runtime.InteropServices; // for using other APIs

[DllImport("coredll.dll")]
public unsafe static extern bool GetExitCodeThread(UInt32 hThread,
UInt32 * lpExitCode);

UInt32 eCode;

GetExitCodeThread((uint)Thread.CurrentThread.ManagedThreadId,
&eCode);

if (eCode == 0x00000103) // constant of STILL_ALIVE
{
MessageBox.Show("Thread still alive");
}


[Note] ..... to check "allow unsafe code" when you build your project.....





"Murthy" wrote:

> Hi,
> I know that there is a method isalive to know if a thread is alive in the
> framework.
> But how do i know if a thread is alive and running in compact framework.
>
> Is there any similar method in .net cf.....??
>
> Thanks in Advance,
> Murthy
>

Re: How to Know is a thread is alive by ctacke/>

ctacke/>
Mon May 21 08:05:44 CDT 2007

The Smart Device Framework[1] has a Thread2 class that provides things like
IsAlive and all of the other "missing" thread methods.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com

[1] www.SmartDeviceFramework.com


"Murthy" <Murthy@discussions.microsoft.com> wrote in message
news:7414E4D8-5787-425E-A3B2-9FD7E19E520D@microsoft.com...
> Hi,
> I know that there is a method isalive to know if a thread is alive in the
> framework.
> But how do i know if a thread is alive and running in compact framework.
>
> Is there any similar method in .net cf.....??
>
> Thanks in Advance,
> Murthy
>



Re: How to Know is a thread is alive by James

James
Wed May 23 19:33:00 CDT 2007

Hello

We've just made a boolean which we set at the beginning to True and at the
end to False
Friend Treadisrunning as boolean = False

Then you have access to the Bool at any place...


"Murthy" <Murthy@discussions.microsoft.com> schrieb im Newsbeitrag
news:7414E4D8-5787-425E-A3B2-9FD7E19E520D@microsoft.com...
> Hi,
> I know that there is a method isalive to know if a thread is alive in the
> framework.
> But how do i know if a thread is alive and running in compact framework.
>
> Is there any similar method in .net cf.....??
>
> Thanks in Advance,
> Murthy
>