FileFindFirst returns large negative number?

 
long searchHandle=FileFindFirst(_subFolder+"\\*",fileFirst);

Hi,

The above code is occasionally returning a large negative number like -1905372416.

This is fooling my code that tests as follows:-

if(searchHandle!=INVALID_HANDLE)

As INVALID_HANDLE equates to -1 only.

I cannot see why I would get such a large negative return value. Any ideas what this represents?

Many thanks.



 
MT4 or MT5 ? Which build ?
 
Alain Verleyen:
MT4 or MT5 ? Which build ?

Sorry, thought I was in the MT4 forum. It's MT4, 1170 -- 20/12/2018

 
Geester:

Sorry, thought I was in the MT4 forum. It's MT4, 1170 -- 20/12/2018

Yes that's true, my fault.

Do you have any idea about "occasionally" ? Can you reproduce it in any way ?