mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-13 10:48:08 +00:00
Issue #100: implemented functions GetLastError, ResetLastError() in MtApi (MT5)
This commit is contained in:
Binary file not shown.
@@ -705,6 +705,14 @@ int executeCommand()
|
||||
case 131: //IndicatorRelease
|
||||
Execute_IndicatorRelease();
|
||||
break;
|
||||
|
||||
case 132: //GetLastError
|
||||
Execute_GetLastError();
|
||||
break;
|
||||
case 143: //ResetLastError
|
||||
Execute_ResetLastError();
|
||||
break;
|
||||
|
||||
default:
|
||||
Print("Unknown command type = ", commandType);
|
||||
sendVoidResponse(ExpertHandle, _response_error);
|
||||
@@ -5508,6 +5516,31 @@ void Execute_IndicatorRelease()
|
||||
PrintResponseError("IndicatorRelease", _response_error);
|
||||
}
|
||||
}
|
||||
|
||||
void Execute_GetLastError()
|
||||
{
|
||||
int last_error = GetLastError();
|
||||
|
||||
#ifdef __DEBUG_LOG__
|
||||
PrintFormat("%s: last_error = %d", __FUNCTION__, last_error);
|
||||
#endif
|
||||
|
||||
SEND_INT_RESPONSE(last_error, "GetLastError");
|
||||
}
|
||||
|
||||
void Execute_ResetLastError()
|
||||
{
|
||||
ResetLastError();
|
||||
|
||||
#ifdef __DEBUG_LOG__
|
||||
PrintFormat("%s: called", __FUNCTION__);
|
||||
#endif
|
||||
|
||||
if (!sendVoidResponse(ExpertHandle, _error))
|
||||
{
|
||||
PrintResponseError("ResetLastError", _response_error);
|
||||
}
|
||||
}
|
||||
|
||||
void PrintParamError(string paramName)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user