FileOpen with Strategy Tester

 

Hello.


I have code that opens a file using 

int file_handle = FileOpen(file_name, FILE_READ | FILE_COMMON | FILE_TXT);

......

FileClose(file_handle);


If I run it with optimization disabled and visual mode disabled, it runs fine the first time, but after that any additional runs return INVALID_HANDLE from FileOpen.


If I run it in visual mode it works every time.


What could be the problem?