dll ini read and performance

 

Hi i  have  a script this , script read a file ini with mql4 code , i notice  is  very slow to load , therefore i try to  create DLL for see a difference of velocity i create a dll this  a code

#include "pch.h"
#include "myfunctions.h"
#include <string>
#include <Windows.h>

// Funzione per leggere il file INI
void _ReadIni(const std::wstring& fileName, const std::wstring& sectionName, const std::wstring& keyName, wchar_t* buffer, DWORD bufferSize) {
        GetPrivateProfileString(sectionName.c_str(), keyName.c_str(), L"", buffer, bufferSize, fileName.c_str());
}

int add(int a, int b)
{
        return a + b;
}

double addDouble(double a, double b)
{
        return a + b;
}
/*
 * Sample function to receive and return a string.
 * `response` is an initialized char array provided by MQL.
 */
void greet(char* name, char* buffer, unsigned int size)
{
        std::string str(name);
        std::string result = "hello " + str;
        strcpy_s(buffer, size, result.c_str());
}

and i load by mql4

//+------------------------------------------------------------------+
//|                                                     provaDLL.mq4 |
//|                                  Copyright 2023, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2023, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window

#import "ProvaDll.dll"
    int add(int, int);
    double addDouble(double, double);
    void greet(char& [], char& [], unsigned int size);
    void _ReadIni(string fileName, string sectionName, string keyName, uchar &buffer[], uint bufferSize);
#import


// Definisci una funzione MQL4 per leggere l'INI
void ReadIni(string fileName, string sectionName, string keyName, uchar &buffer[], uint bufferSize) {
    _ReadIni(fileName, sectionName, keyName, buffer, bufferSize);
}

// Esempio di utilizzo della funzione ReadIni
void OnStart()
{
    uchar buffer[256];
    string fileName = "correlazioni.ini";
    string sectionName = "Primario";
    string keyName = "symbl1";

    ReadIni(fileName, sectionName, keyName, buffer, ArraySize(buffer));

      Print("Value from INI: ", buffer[0]);
}

but  not print nothing and  not return error  , whats  wrong ??

anyone  have some idea?? thanks  at all