我正在构建一个基于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来确定我在监控哪个线程。
发布于 2015-08-15 00:58:30
CreateThread调用的最后一个参数是指向将接收线程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;
}https://stackoverflow.com/questions/28722034
复制相似问题