MT5 : get INVALID_HANDLE error if using FileFindFirst() in OnChartEvent()


MT5 question

Hi guys,

I'm have a button on my panel and need to call FileFindFirst() to get handle of files in a folder when clicking on the button. 

everthing is good at mql4, buy I want to convert my source code to mql5. 

I don'k know why i can not get file_handle by click event. if I click on a button file_handle is INVALID_HANDLE. Buy if I call the function some where else the file handle is valid.

this problem is occurred only in MT5 platform !

I have a similar  problem....Did you ever find a solution?