Download MetaTrader 5
To add comments, please log in or register
Install apps from the library right in MetaTrader. It is easy!
Paul B
173
Paul B 2014.02.16 17:52 

Hi,

more annoying than a major problem, but when I try and use the following I get the "truncation of constant value Error"

#define INTERNET_FLAG_RELOAD            0x80000000

#import "wininet.dll"
   int InternetOpenUrlW(int, string, string, int, int, int);
#import

InternetOpenUrlW(hOpen, sUrl, NULL, 0, INTERNET_FLAG_RELOAD, 0);

I realise that 0x80000000 is equivalent to the integer 2147483648, and that an integer in mql has a maximum value of 2147483647 and this is causing the error, but does anyone know a workaround?

Thanks

PaulB

whroeder1
13656
whroeder1 2014.02.16 18:26  
Paul_B: I realise that 0x80000000 is equivalent to the integer unsigned integer 2147483648, and that an integer in mql has a maximum value of 2147483647
// int InternetOpenUrlW(int, string, string,  int,  int,  int);
   int InternetOpenUrlW(int, string, string, uint, uint, uint);
InternetOpenUrl function (Windows)
http://msdn.microsoft.com /en-us /library /windows /desktop /aa385098(v=vs.85).aspx
HINTERNET InternetOpenUrl(
  _In_  HINTERNET hInternet,
  _In_  LPCTSTR lpszUrl,
  _In_  LPCTSTR lpszHeaders,
  _In_  DWORD dwHeadersLength,
  _In_  DWORD dwFlags,
  _In_  DWORD_PTR dwContext
);
Alain Verleyen
Moderator
28701
Alain Verleyen 2014.02.16 18:27  
Paul_B:

Hi,

more annoying than a major problem, but when I try and use the following I get the "truncation of constant value Error"

I realise that 0x80000000 is equivalent to the integer 2147483648, and that an integer in mql has a maximum value of 2147483647 and this is causing the error, but does anyone know a workaround?

Thanks

PaulB

#import "wininet.dll"
   int InternetOpenUrlW(int, string, string, int, uint, int);
#import
Paul B
173
Paul B 2014.02.16 18:37  

Brilliant, thanks, that was simple.

Kind regards

PaulB

/
To add comments, please log in or register