C++ 使用TID查找线程

C++ 使用TID查找线程,c++,multithreading,windows-embedded-compact,C++,Multithreading,Windows Embedded Compact,我正在基于wec7构建一个应用程序。我有以下线索: bool ChannelDataQueue::b_ChannelDataQueue_StartThread() { m_hThread = CreateThread(NULL, 0, ChannelDataQueue::u32_ChannelDataQueue_ReadChannelData, (LPVOID)this, CREATE_SUSPENDED, NULL); CeSetThreadPriority(m_hThread,

我正在基于wec7构建一个应用程序。我有以下线索:

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;
}
我正在使用VS2008中的远程工具来监视进程和线程,但是线程只显示它们所在的进程和TID/PID。我不知道如何根据线程ID确定我正在监视哪个线程。

调用的最后一个参数是指向将接收线程ID的DWORD的指针

例如:

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;
}