Premature Thread Termination
Terminating a thread prematurely is almost as simple: CallAfxEndThread from within the thread. Pass the desired exit code as the only parameter. This stops execution of the thread, deallocates the thread’s stack, detaches all DLLs attached to the thread, and deletes the thread object from memory.AfxEndThread must be called from within the thread to be terminated. If you want to terminate a thread from another thread, you must set up a communication method between the two threads.
Terminating a thread prematurely is almost as simple: CallAfxEndThread from within the thread. Pass the desired exit code as the only parameter. This stops execution of the thread, deallocates the thread’s stack, detaches all DLLs attached to the thread, and deletes the thread object from memory.AfxEndThread must be called from within the thread to be terminated. If you want to terminate a thread from another thread, you must set up a communication method between the two threads.
解决方案 »
- 请教在XP SP3 上面,不装VC2008Redist.exe发布程序的方法
- 如何实现Edit控件之间的切换
- vc++安装问题 急!!!!!!!!!!在线等
- 谁能提供一个SourceSafe6的下载啊?
- windows程序设计交流QQ群2850668
- DWORD和WORD,int的问题
- 进程间线程同步的问题?
- 论坛可以这样用:拿来收藏自己喜欢的文章《win2000用户态执行ring0代码》
- 如何运用一个程序的退出码?
- 主题: 在对话框中试图Move控件却发现运行时出现Assert Vaild 错误, 为何? 因为我没有初始化???
- 如何改变本机的IP地址???
- 如何用Daemon解压ISO文件?
http://www.csdn.net/expert/topic/94/94933.shtm
_______________________________________________________________________________
程序员论坛白庄http://www.baizhuang.net欢迎你的加盟!!
如果CWinThread可以接受WM_CLOSE等退出消息可以用PostMessage()发送退出消息。至于响应哪个消息,你查查吧!//推荐
我给大家分了。