rapidlord
asked on
catching current thread
what i need is to catch thread in moment when it`s active, when i create thread with:
thread[2]=AfxBeginThread(w orking, hWnd, THREAD_PRIORITY_NORMAL); //CWinThread* thread[100];
thread[2] get decimal value (%d) for example '42815072' but when i call:
CurrentThread=AfxGetThread ()->m_nThr eadID // volatile unsigned int CurrentThread;
CurrentThread get decimal value (%d) fo example '1554', but i now that CurrentThread in that moment
is thread[2].
How can i compare current thread with some thread from line thread[100] example
if ( AfxGetThread()->m_nThreadI D==thread[ 2]) {// ...... } can be done in this way or there is another tactic.
Or haw can i get shorter value (1554) in thread[2] so i can compere it with
AfxGetThread()->m_nThreadI D
tnx for your time.
Vlad
thread[2]=AfxBeginThread(w
thread[2] get decimal value (%d) for example '42815072' but when i call:
CurrentThread=AfxGetThread
CurrentThread get decimal value (%d) fo example '1554', but i now that CurrentThread in that moment
is thread[2].
How can i compare current thread with some thread from line thread[100] example
if ( AfxGetThread()->m_nThreadI
Or haw can i get shorter value (1554) in thread[2] so i can compere it with
AfxGetThread()->m_nThreadI
tnx for your time.
Vlad
GetCurrentThreadID() gives you the thread id of the thread you are currently in.
ASKER
GetCurrentThreadID() returning the same value like AfxGetThread()->m_nThreadI D so its again same thing i can compare it with 'thread[2]' IT`S NOT THAT.
sory
sory
ASKER
GetCurrentThreadID() returning the same value like AfxGetThread()->m_nThreadI D so its again same thing i can compare it with 'thread[2]' IT`S NOT THAT.
sory
sory
ASKER
GetCurrentThreadID() returning the same value like AfxGetThread()->m_nThreadI D so its again same thing i can compare it with 'thread[2]' IT`S NOT THAT.
sory
sory
Hi No its not same
Thread id and thread handle both are different thing you can not compare these two
Thread id and thread handle both are different thing you can not compare these two
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.