The MQL program (script or Expert Advisor) calls the Visual C++ DLL for network communication, the DLL interface function creates a thread to wait for and receive data, when the socket has data arrival, the thread receives the data and then inform the script or Expert Advisor to display it in the chart. When the chart is closed, if the sender continues to send data, the problem occurs in the terminal as follows:
When the chart is closed, the MQL program (script or Expert Advisor) end, but the thread that create by DLL interface function does not exit, in this case, if the sender continue to communicat with the thread, the problem above occurs; if the thread exit before the closing of the chart, that problem does not occurs. How can you exit the thread that create by the DLL interface function before the chart is closed?
To add comments, please log in or register