API Support Forum
OEC API > API Support > WM_TIMER id 1
Author Topic: WM_TIMER id 1
(2 messages, Page 1 of 1)
Moderators: VPfau
PArnoldson
Posts: 154
Joined: Oct 03, 2007


Posted: Oct 24, 2008 @ 02:39 PM             Msg. 1 of 2
When running our program on an xp machine. Connecting to the API and doing nothing else and letting the program idle. The cpu would go up to 100%. looking into this more we noticed that there is a WM_TIMER with id 1 that is being fired a lot (very often) from the api. This was causing a small enough gap between firing to do an onIdle call after each one. This is what was causing the cpu to go to 100%. We have put a work around for this in our software to ignore the onidle call after this timer is fired. This fixes the problem with the cpu going to 100%, but we are wondering why this timer is there? What it does? Is it necessary? If it is not necessary to have it we would like it removed and maybe for a temporary fix we could code in to our software to kill that timer. We will wait your response for the purpose of this timer with the id of 1.

"For every complex problem, there is a solution that is simple, neat, and wrong." H.L. Mencken
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Oct 24, 2008 @ 02:54 PM             Msg. 2 of 2
Though we never experienced 100% CPU load, I would suggest to experiment with setting OECClient.EventBatchInterval to higher value, for example 100(ms).

Also note that Microsoft does not recommend to perform lengthy tasks during OnIdle.

We could not guarantee correct functioning of OEC API if you interfere with its message processing or timers.