Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1016

 
eevviill:

I think all thongs should be done like that.

The data about that list is stored in the terminal-config-experts folder

But it is very unclear there. I have to ask the developers.

thanks), the thing is that only sendRequest does not work all functions required before sending the request is fine (and if I use OpenURL then everything also works) but if I still do through a charto openRequest also stops working...
ps I saw somewhere yesterday in net how someone told at what forum that may be added to html page list via macro #define and another said to him that this is a hole in language... but then it was not necessary ... and now I can not find how I searched(
so far no luck figuring it out .... too bad.

ps2 the file is empty)))) opened it and looked through the gap added a handwritten note... had to delete the file because the terminal began to fly)))) but where do these developers need to write?
 
Money_Maker:
Can you please tell me what's the reason?HttpSendRequestW doesn't send request... GetLastError gives 0.

(the interesting thing is that WebRequest second version of it works... )


You need to use the system GetLastError(). It doesn't give zero.

#import "Kernel32.dll"
   uint GetLastError();
   uint GetModuleHandleW( string lpModuleName );
   uint FormatMessageW( uint dwFlags, uint lpSource, uint dwMessageId, uint dwLanguageId, ushort& lpBuffer[], uint nSize, uint Arguments );
#import

#define  FORMAT_MESSAGE_FROM_HMODULE 0x0800

ushort buffer[1024];

   // отправили файл
   int hSend = HttpSendRequestW( hRequest, HEADERS, StringLen( HEADERS ), data, ArraySize( data ) );
    
   if( hSend == 0 )
   {
      uint error = Kernel32::GetLastError();
      uint len = FormatMessageW( FORMAT_MESSAGE_FROM_HMODULE, GetModuleHandleW( "wininet.dll" ), error, 0, buffer, 1024, 0 );
      string errorString = ShortArrayToString( buffer, 0, len );
      
      Print( errorString );
      InternetCloseHandle( hRequest );
      CloseInet();
   }
 
Money_Maker:
thanks), the thing is that only sendRequest does not work all functions required before sending the request is ok (and if I use OpenURL then everything works too) but if I do it through charto openRequest also stops working...
ps I saw yesterday somewhere in net how someone told at what forum that lets add to the list html page through macro #define and another tells him that this is a hole in language... but then it was not necessary ... and now I can not find how I searched(
so far no luck figuring it out .... too bad.

ps2 the file is empty)))) i had to delete the file because the terminal kept crashing)))) but where should i write to the developers?
mql5 site - servicedesk
 
Ko1dun:

You need to use the system GetLastError(). It does not give zero.

Thank you very much at least now I see where to look)

Wrong URL. Now I know what to think)

it turns out the format was 95.213.188.133:80 and not as in the address bar...strange OpenUrl doesn't care what address andWebRequest does too
 
Money_Maker:
Thank you very much at least now I see where to dig)

It says invalid URL. Now I know where to think)

it turns out the address was intended in this format 95.213.188.133:80 and not as in the address bar... strange OpenUrl does not care what the address and WebRequest too

In InternetConnect you only need to pass the server name without protocol: "ru.investing.com".

And in HttpOpenRequest only the requested object: "earnings-calendar/Service/getCalendarFilteredData".

 
eevviill:

from, to, what to do

for(int i=1;i<=5;i++)

or

for(int i=5;i>=1;i--)

But yes. The more logical thing to do during development was to make

with, what to do, to

for(int i=1;i++;i<=5)

Thank you very much, Vasily!
 

How do I make the meter work in the tester instead of constantly showing 1?

int a;

int OnInit()
{
a++;
return(0);
}

 
Ko1dun:

In InternetConnect you only need to pass the server name without the protocol: "ru.investing.com".

In HttpOpenRequest only the requested object: "earnings-calendar/Service/getCalendarFilteredData".

Thank you very much, your advices are very helpful! Unfortunately there is very little information about WinInetDll in russian and for mql. I know nothing about the details. I have to search by experience || someone will tell me.
 
gghjhgjfgjhf:

How do I make the meter work in the tester instead of constantly showing 1?

int a;

int OnInit()
{
a++;
Comment(a);
return(0);
}

Read whatOnInit does and what it is for)
 
Could you please tell me the data<td colspan="8\" class=\"theDay\">\u0421\u0440\u0435\u0434\u0430, \u0410\u043f\u0440\u0435\u043b\u044c 20, 2016</td>\n UTF-8 format

I understand correctly, that russian needs to be converted to ANSI, i.e. to CP_ACP?

I do it like this string ttt =CharArrayToString(RESULT,0,CP_ACP); Nothing changes, just the data is stored in the string variable
Saving into a file under CP_ACP does not work either.
I am doing something wrong . The output is heDay\">Wednesday, April 20, 2016<\/td>\n (I also used uurlencoded post filter when converting from UTF-8)
THE QUESTION is how to do it in MQL?