Issue #100: implemented functions GetLastError, ResetLastError() in MtApi (MT5)

This commit is contained in:
vdemydiuk
2018-03-09 19:18:54 +02:00
parent ec6c71607b
commit cab2de6d24
7 changed files with 113 additions and 13 deletions
BIN
View File
Binary file not shown.
+33
View File
@@ -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)
{