cannot set millisecond timer (500) - page 4

 
Dmitriy Falkov:

Added to OnInit():

   int error=-1;
   int counter=1;
   do
   {
      ResetLastError();
      EventSetMillisecondTimer(Timer);
      error=GetLastError();
      Print("EventSetMillisecondTimer. Attempt=",counter," Error=",error);
      if(error!=0) Sleep(1000);
      counter++;
   }
   while(error!=0 && !IsStopped());

And observed the following. Five failed attempts. At the same time I close the adjacent terminal, which has no charts, but only copying trades stands. Immediately I have good luck. The timer initialized.

Thank you. This is a really working idea. I will take it on board.

By the way, recently updated mt5 - there are less brakes. maybe the timer will stop glitching on UPU ? - not checked, my timer works fine - not working for clients.

 
Vladislav Andruschenko:

the error is always the same 4024

4027 - unknown error, just fine. I haven't noticed this yet.
 

I have,"cannot set millisecond timer (500)" message.


This happened on my AND VPS on ALL 16 working live platforms, and with BOTH my brokers.

I bought a NEW EA and it also showed "cannot set millisecond timer (100)" but (100)!

Perhaps this will help to detect.

Regards,
 

Dear Admin,

today the timer error appears on almost all clients, what can it be ? why all this and what to do ?

error 1158

Maybe this will help ?

But, on my latest build from Feb 3, Intel Windows 64 processor - everything is ok.

I.e. the problem is only with others. :-(

a little more information, the error does not appear immediately, about an hour or two later:

0       09:10:37.921    Exp  MASTER for MT4 EURGBPpro,H1:  RUN 2017.02.06 04:11
0       09:10:37.921    Exp  MASTER for MT4 EURGBPpro,H1: Balance =34876-34876
0       09:10:37.947    Exp  MASTER for MT4 EURGBPpro,H1: initialized
0       09:10:37.970    Exp  MASTER for MT4 EURCADpro,H1:  RUN 2017.02.06 04:11
0       09:10:37.970    Exp  MASTER for MT4 EURCADpro,H1: Balance =34876-34876
0       09:10:37.971    Exp  MASTER for MT4 EURCADpro,H1: initialized
1       11:52:23.877    Exp  MASTER for MT4 EURGBPpro,H1: EventSetTimer(700) error 1158
0       11:52:23.887    Exp  MASTER for MT4 EURGBPpro,H1: Error with timer 0

I just looked on my second computer, the same error popped up. The timer stopped working, the Advisor drained :-(

 
Vladislav Andruschenko:

Dear Admin,

today the timer error appears on almost all clients, what can it be ? why all this and what to do ?

error 1158

Maybe this will help ?

But, on my latest build from Feb 3, Intel Windows 64 processor - everything is ok.

I.e. the problem is only with others. :-(

Error 1158 is a system error indicating that you cannot set the timer

ERROR_NO_MORE_USER_HANDLES 1158 (0x486)

The current process has used all of its system allowance of handles for Window Manager objects.

 
I am using the same Expert Advisor, today I got the error 1158 + MT4 functions blocked for opening-closing of orders and chart properties (maybe some other functions have not yet been tested)
 
Slawa:
Error 1158 is a system error saying that the timer cannot be set

ERROR_NO_MORE_USER_HANDLES 1158 (0x486)

The current process has used all of its system allowance of handles for Window Manager objects.

Yes, but it started to appear quite recently, after the December build.

And not for all, not always. And on different Expert Advisors.

How can it be solved, what are the options?

I had it in the initialization function. - The error was showing and the EA did not work.

I have also put it in Tick - in case the timer is not set, the EA will work by ticks (even though this is a large crutch).

what other options?

And most importantly: Why does this happen? how to prevent it? not enough space? not enough memory? processor?

I really hope for help, or at least solutions. I'm not the only one who suffers.

 
Start by observing in Task Manager how many handles the client terminal is using.

Open and close charts. Run Expert Advisors and indicators. And watch how the number of handles changes
 
Slawa:
First, observe in task manager how many handles the client terminal is using.

Open and close charts. Run experts and indicators. And watch how the number of handles changes

After restarting everything is OK, but after 1-2 hours the timer goes off again

 
Control the number of handles used. You are only outputting memory and CPU

Right-click on the row with column headers - "Select columns". Check the "Descriptors" box
Reason: