Skip to content

Commit a0a4263

Browse files
committed
Issue #190: implemented function sendErrorResponse in Mt5Connector
1 parent 5d18dd4 commit a0a4263

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

MT5Connector/MT5Connector.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,16 @@ _DLLAPI int _stdcall sendMqlRatesArrayResponse(int expertHandle, CMqlRates value
208208
}, err, 0);
209209
}
210210

211+
_DLLAPI bool _stdcall sendErrorResponse(int expertHandle, int code, wchar_t* message, wchar_t* err)
212+
{
213+
return Execute<bool>([&expertHandle, &code, message]() {
214+
MtResponseString^ res = gcnew MtResponseString(gcnew String(message));
215+
res->ErrorCode = code;
216+
MtAdapter::GetInstance()->SendResponse(expertHandle, res);
217+
return true;
218+
}, err, false);
219+
}
220+
211221
//----------- get values -------------------------------
212222

213223
_DLLAPI int _stdcall getCommandType(int expertHandle, int* res, wchar_t* err)

0 commit comments

Comments
 (0)