CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 64 % of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.

URLDownloadToFileW Doesn’t work on my VPS

Hi everyone, perhaps you can help, the following function usage works properly on my local pc but fails on my vps:

#import “urlmon.dll”

int URLDownloadToFileW(int pCaller,string szURL,string szFileName,int dwReserved,int Callback);

#import

I am trying to use it to read a price and display it as part of an Metatrader 4 indicator. Any idea what could be the server issue?

The most likely reason is that the dll file is not on the Vps.

1 Like

It’s there, but seems there’s something blocking the usage of it. Potentially I need to configure the windows sever 2012 r2 somehow to allow it. When I switch to the mql4 function all works fine, but still, I would like to do the http call from within an indicator.

When you look in Tools | Options on the Expert Advisors tab, have you got the checkbox to ‘allow dlls imports’ checked?

1 Like