"MetaTrader has stopped working...". Have you encountered this problem? Thank you for entering my topic.

 

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? 

 

open a terminal CMD and type eventvwr then enter

then look in your logs to see if there is a crash code about the event.

 
Marco vd Heijden:

open a terminal CMD and type eventvwr then enter

then look in your logs to see if there is a crash code about the event.

The windows log as follows:

错误应用程序名称: terminal.exe,版本: 4.0.0.840,时间戳: 0x00ad7e00

错误模块名称: MSVCR100.dll_unloaded,版本: 0.0.0.0,时间戳: 0x4df2be1e

异常代码: 0xc0000005

错误偏移量: 0x6b26b65a

错误进程 ID: 0x1d68

错误应用程序启动时间: 0x01d0af08bef19454

错误应用程序路径: C:\Program Files\FXCM MetaTrader 4\terminal.exe

错误模块路径: MSVCR100.dll

报告 ID: 26b23077-1afc-11e5-ba83-d027884f6667

 

错误应用程序名称: terminal.exe,版本: 4.0.0.840,时间戳: 0x00ad7e00

错误模块名称: Receive.dll_unloaded,版本: 0.0.0.0,时间戳: 0x558b792b

异常代码: 0xc0000005

错误偏移量: 0x74181209

错误进程 ID: 0x1d68

错误应用程序启动时间: 0x01d0af08bef19454

错误应用程序路径: C:\Program Files\FXCM MetaTrader 4\terminal.exe

错误模块路径: Receive.dll

报告 ID: 369f922b-1afc-11e5-ba83-d027884f6667