Download MetaTrader 5
To add comments, please log in or register
How to use MQL5.community messages editor? Find out in the article!
Bambang Sugianto
9831
Bambang Sugianto 2014.02.06 18:32 

hello Guys.. i just realize that wininet not working if i compile it on metaeditor build 600

 
#import  "Wininet.dll"
   int InternetOpenA(string, int, string, string, int);
   int InternetConnectA(int, string, int, string, string, int, int, int); 
   int HttpOpenRequestA(int, string, string, int, string, int, string, int); 
   int InternetOpenUrlA(int, string, string, int, int, int);
   int InternetReadFile(int, string, int, int& OneInt[]);
   int InternetCloseHandle(int); 
   int InternetCloseHandle(int); 
   int InternetCloseHandle(int); 
#import
 
int start()
{
   
      int HttpOpen = InternetOpenA(" ", 0, " "," ",0 ); 
    int HttpConnect = InternetConnectA(HttpOpen, "", 80, "", "", 3, 0, 1); 
    int HttpRequest = InternetOpenUrlA(HttpOpen, "https://dl.dropboxusercontent.com/u/52625414/testing.csv", NULL, 0, 0, 0);
   
   int read[1];
   string Buffer = " ";
   string page = "";
 
   while (true)
   {
      InternetReadFile(HttpRequest, Buffer, StringLen(Buffer), read);
      if (read[0] > 0) page = page + StringSubstr(Buffer, 0, read[0]);
      else             break;
   }
   
   MessageBox(page, "HTTP READ:" );
   
   if (HttpRequest > 0) InternetCloseHandle(HttpRequest); 
   if (HttpConnect > 0) InternetCloseHandle(HttpConnect); 
   if (HttpOpen > 0) InternetCloseHandle(HttpOpen); 
 
   //----
   return(0);
}
  
//+------------------------------------------------------------------+

this one i compile with build 509

this one i compile with 509

fail

this one i compile with build 600

i attach EX4 file that i compile with build 509

Files:
tesinet.ex4 5 kb
sergery
281
sergery 2014.02.06 18:36  

Refer to this post https://forum.mql4.com/60608

Bambang Sugianto
9831
Bambang Sugianto 2014.02.06 18:37  

it seem like we can't download the file

please Help..

Bambang Sugianto
9831
Bambang Sugianto 2014.02.06 18:41  

Thanks Sergery

now it works again

i change A to W

   int InternetOpenW(string, int, string, string, int);
   int InternetConnectW(int, string, int, string, string, int, int, int); 
   int HttpOpenRequestW(int, string, string, int, string, int, string, int); 
   int InternetOpenUrlW(int, string, string, int, int, int);
/
To add comments, please log in or register