I am running an apache server on my computer and use localhost. That's why I don't get the error message you got but instead I get the error "Access violation read to 0x0000007B in 'Wininet.dll'" i using "HttpOpenRequestW".
Well, I don't know whether "HttpOpenRequestW" or "HttpOpenRequestA" is correct. Now I use "HttpOpenRequestA" otherwise I have the error message "Access violation read to 0x0000007B in 'Wininet.dll'".
Regarding URLs I tried so many different other URLs, even the one from your example (changed POST to GET etc.):
again as i said before something is wrong with the URL (the error codes doesn't lie) and of course i'm using "HttpOpenRequestW" and not "HttpOpenRequestA"
here is a working code (returns true and there is no error):
string headers = "Content-Type: application/x-www-form-urlencoded";
string data = "";
string acceptTypes[1] = {""};
int HttpOpen = InternetOpenW(" ", 0, " ", "", 0);
int HttpConnect = InternetConnectW(HttpOpen, "www.forexfactory.com", 80, "", "", 3, 0, 0);
int HttpRequest = HttpOpenRequestW(HttpConnect, "GET", "ff_calendar_thisweek.xml", "", "", acceptTypes, 0, 0);
bool result = HttpSendRequestW(HttpRequest, headers, StringLen(headers), data, StringLen(data));
Alert ("Last MSDN Error =: ", kernel32::GetLastError());
int read[1];
Print("This is the POST result: ", result);
InternetCloseHandle(HttpOpen);
InternetCloseHandle(HttpRequest);
I tested the code on other computers and even on other computers I still get the error: "Access violation read to 0x0000007B in 'Wininet.dll'" using "HttpOpenRequestW".
I tested the code on other computers and even on other computers I still get the error: "Access violation read to 0x0000007B in 'Wininet.dll'" using "HttpOpenRequestW".
It's getting really disappointing :-(.
Microsoft declares
_In_ LPCTSTR *lplpszAcceptTypes
for the access parameter. I am not sure if a pointer to the string[] is compatible with it. I would try changing the string[]& to string&.
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.
many thanks!
I am running an apache server on my computer and use localhost. That's why I don't get the error message you got but instead I get the error "Access violation read to 0x0000007B in 'Wininet.dll'" i using "HttpOpenRequestW".
Have you tried another url?
Yes, even with the fixed code.
This is my code:
Interesting is that if I change "HttpOpenRequestW" to "HttpOpenRequestA" I receive also the error 12005.
Well, I don't know whether "HttpOpenRequestW" or "HttpOpenRequestA" is correct. Now I use "HttpOpenRequestA" otherwise I have the error message "Access violation read to 0x0000007B in 'Wininet.dll'".
Regarding URLs I tried so many different other URLs, even the one from your example (changed POST to GET etc.):
again as i said before something is wrong with the URL (the error codes doesn't lie) and of course i'm using "HttpOpenRequestW" and not "HttpOpenRequestA"
here is a working code (returns true and there is no error):
I tested the code on other computers and even on other computers I still get the error: "Access violation read to 0x0000007B in 'Wininet.dll'" using "HttpOpenRequestW".
It's getting really disappointing :-(.
I tested the code on other computers and even on other computers I still get the error: "Access violation read to 0x0000007B in 'Wininet.dll'" using "HttpOpenRequestW".
It's getting really disappointing :-(.
Microsoft declares
for the access parameter. I am not sure if a pointer to the string[] is compatible with it. I would try changing the string[]& to string&.
If I do the change I receive the error message "'&' - reference cannot used".