0

I am building an application based on wec7. I have the following thread:

bool ChannelDataQueue::b_ChannelDataQueue_StartThread()
{
   m_hThread = CreateThread(NULL, 0, ChannelDataQueue::u32_ChannelDataQueue_ReadChannelData, (LPVOID)this, CREATE_SUSPENDED, NULL);

   CeSetThreadPriority(m_hThread,CE_THREAD_PRIO_256_HIGHEST);
  //SetThreadPriority(m_hThread,249);//248
  ResumeThread(m_hThread);

  return true;
}

I am using the remote tools in VS2008 to monitor the processes and threads, but the threads only show up with the process they are in and TID/PID. I dont know how to determine which thread i am monitoring based on its ID.

Javia1492
  • 862
  • 11
  • 28

1 Answers1

0

The last parameter to the CreateThread call is a pointer to a DWORD that will receive the thread ID.

Example:

bool ChannelDataQueue::b_ChannelDataQueue_StartThread()
{
    DWORD threadID;

    m_hThread = CreateThread(NULL, 0, ChannelDataQueue::u32_ChannelDataQueue_ReadChannelData, (LPVOID)this, CREATE_SUSPENDED, &threadID);

    // At this point, inspect the threadID in the debugger,
    // print it to the console, write it to a file, etc...

    CeSetThreadPriority(m_hThread,CE_THREAD_PRIO_256_HIGHEST);
    //SetThreadPriority(m_hThread,249);//248
    ResumeThread(m_hThread);

    return true;
}
Carsten Hansen
  • 1,508
  • 2
  • 21
  • 27