• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 364
  • Last Modified:

CWinApp. Idle process time without hang the CPU.

I have a CWinApp object attached to a CDialog:
my_CDlg_ptr=new my_CDlg;
m_pMainWnd=(CWnd*)my_CDlg_ptr;
My app needs to do things all the time, so I overload CWinApp::OnIdle(), to do such things. The point is: if I retrurn CWinApp::OnIdle(), the function is called only one time, and If I return TRUE, the CPU Usage in TaskManager is 100% all the time.
What can I do, to give my app. Idle process time, without hang the cpu?
0
wau
Asked:
wau
1 Solution
 
cyrilbdtCommented:
better create another thread and there "do things all the time" or create timer and catch WM_TIMER message

hope this helps
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now