In this article, we will use the WinHttp.dll to create a WebSocket client for MetaTrader 5 programs. The client will ultimately be implemented as a class and also tested against the Binary.com WebSocket API.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
hi, I have used this great article for mt5 to connect to a wss api. which is working fine.
but the same code in mt4 does not work at the very first line
long http_open_result = WinHttpOpen("mt4",WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,NULL,NULL,/*reserved parameter*/0);
I think sending that string is facing problem.
"stack damaged, check DLL function call"
I searched a lot but yet I couldn't find a solution on how to send string from mt4 to winhttp.dll and it accepts it.
I think there maybe issue between 64bit ( mt5) and 32 bit ( mt4 ) as in 64 bit strings are 8 byte and in 32 bit they are 4bytes.
but they say the recent versions of mt4 is also 64 bit . so how a dll is working from mt5 but crashing from mt4 ?
maybe I should use a solution like creating a custom dll . sending data to this middle dll , and that handles the connections to the windows dll ?
https://www.mql5.com/en/forum/143101#comment_3618861
https://www.mql5.com/en/forum/150219
https://www.mql5.com/en/forum/150000
any helps/ideas would be appreciated.