CWinThread-通过休眠/待机管理线程 [英] CWinThread - managing a thread through Hibernation / Standby
问题描述
我有一个能够从连接的设备实时检索数据的应用程序.
所有实时采集都在与主应用程序分开的CWinThread上进行管理.
这个单独的线程正在更新一个对话框,以显示检索到的值.我发现我的应用程序在PC休眠之前或启动过程中在CWinThread代码内崩溃.
有没有一种方法可以管理线程,以使休眠过程不会使我的应用程序崩溃?
我想补充一点,我正在Windows XP计算机上使用Visual C ++ .Net.
TIA
Tony
Hi,
I have an application that is able to retrieve data in realtime from an attached device.
All realtime acquisition is managed on a separate CWinThread from the main application.
This separate thread is updating a dialog to display the values retrieved. What I am finding is that my application is crashing within the CWinThread code either prior to my PC hibernating, or during the start up process.
Is there a way to manage the threads so that the hibernation process does not crash my application?
I''d like to add that I am using Visual C++ .Net on a Windows XP machine.
TIA
Tony
推荐答案
不确定是什么原因导致崩溃的,但是如果您可以检测到休眠消息,则可以先调用SuspendThread
,然后再调用ResumeThread
机器醒来.值得一试.
Not sure what''s causing the crash, but if you can detect the hibernation message, you could callSuspendThread
and then callResumeThread
when the machine wakes up. Worth a try.
这篇关于CWinThread-通过休眠/待机管理线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!