有关多线程的中有些线程无法回应的问题

swjj 2002-01-24 10:39:09

如该线程超时,我用终止它

但同时出现下面的报错



LRESULT CALLBACK _AfxMsgFilterHook(int code, WPARAM wParam, LPARAM lParam)
{
CWinThread* pThread;
if (afxContextIsDLL || (code < 0 && code != MSGF_DDEMGR) ||
(pThread = AfxGetThread()) == NULL)
{
return ::CallNextHookEx(_afxThreadState->m_hHookOldMsgFilter,
code, wParam, lParam);
}
ASSERT(pThread != NULL);//////////////该处出错
return (LRESULT)pThread->ProcessMessageFilter(code, (LPMSG)lParam);
}

/////////////以上是在\mfc\src\thrdcode.cpp 中的内容


/////以下是报错界面





Warning: throwing CInternetException for error 12017
The thread 0xFFF7B18D has exited with code -3 (0xFFFFFFFD).
First-chance exception in InfoNotice.exe (BCCORE.DLL): 0xE06D7363: Microsoft C++ Exception.
First-chance exception in InfoNotice.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
First-chance exception in InfoNotice.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
First-chance exception in InfoNotice.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
First-chance exception in InfoNotice.exe: 0xC0000005: Access Violation.
The program 'C:\aa1.exe' has exited with code 0 (0x0).
...全文
77 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
bugsalwaysare 2002-02-27
  • 打赏
  • 举报
回复
0xc000005是protection violation ,可能是你的线程终止时,去closehandle非本线程创建的内核对象。
cmpp 2002-02-27
  • 打赏
  • 举报
回复
http://www.csdn.net/expert/topic/544/544226.xml
swjj 2002-01-24
  • 打赏
  • 举报
回复


产生线程
m_cx1=(CMyInternetForResiter*)AfxBeginThread((CRuntimeClass*) RUNTIME_CLASS(CMyInternetForResiter),THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED,NULL);


终止线程

TerminateThread(m_cx1->m_hThread,-3);

1,649

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 非技术类
社区管理员
  • 非技术类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧