Metatrader5 MacOS - Problem with Wininet.dll and FtpGetFileW

 

Hello everyone,

I recently coded an expert that allows me to automatically download various files from my FTP server and also upload my trading statistics to the same server. On MetaTrader 5, Windows version, the code works perfectly! However, when I tried it on my Mac, there seems to be an issue with the "FtpGetFileW" function of Wininet.dll.

No problem using the functions : InternetOpenW(); InternetConnectW(); FtpPutFileW(); FtpSetCurrentDirectoryW(); InternetCloseHandle();

bool DownloadFTP(string fichier)
{
    int hIntObj, hIntObjConn;
    string LocalFile, HostFile;
    bool Success = false;
    string dossier = "myftp";
 
    hIntObj = InternetOpenW("ftpconnecthandle", 1, NULL, NULL, NULL);
    if (hIntObj > 0)
    {
        hIntObjConn = InternetConnectW(hIntObj, ServerName, 21, UserName, Password, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, NULL);
        if (hIntObjConn > 0)
        {
            LocalFile = TerminalInfoString(TERMINAL_DATA_PATH) + "\\MQL5\\Files\\" + fichier;
            HostFile = fichier;
            Success = FtpGetFileW(hIntObjConn, HostFile, LocalFile, false, FILE_SHARE_WRITE, FTP_TRANSFER_TYPE_BINARY, 0);
        }
    }
    InternetCloseHandle(hIntObj);
    return (Success);
}

The FtpGetFileW() function does not work on MacOS but perfect on Windows... do you have a solution for this problem ?
I tried replacing the Wininet.dll of Wine (installed with Metatrader5 MacOS) with the version of Wininet.dll from my Windows computer, but it does not work or even prevents MetaTrader from opening completely.
Same problem with PlayToMac.

Thanks in advance for your help.


Ps : first post on mql5 ... and just see i posted on bad category ... is there an admin for mooving this post on correct forum category ?

Reason: