terminal gives error "DLL loading is NOT allow".--(test mode)

 

Current issue 

 Because loading DLL failed as test , want to project setting file to enable "AllowDLLImport"

message "2020.01.01 00:00:00 DLL loading is not allowed"

             "global initialization failed", "global initialization critical error"

             "tester stopped because expert initialization failed"

Need some body help  do this~

csv_excel.ini

[Experts]
AllowDllImport=1
Enabled=1

[StartUp]
AllowDllImport=1

[Tester]
AllowDllImport=1


I check this "https://www.metatrader5.com/en/terminal/help/start_advanced/start"


Original issue  How to open script as onDeinit/OnInit

Do script file as OnDeinit/OnInit ?

void OnDeinit(const int reason)
{
        SystemCall(Script_Export_History_Deals.mq5 (input start_time,input end_time) );// ???
        Execute(xxxx);
}
Documentation on MQL5: MQL5 programs / Runtime Errors
Documentation on MQL5: MQL5 programs / Runtime Errors
  • www.mql5.com
The executing subsystem of the client terminal has an opportunity to save the error code in case it occurs during a MQL5 program run. There is a predefined variable _LastError for each executable MQL5 program. Before starting the OnInit function, the _LastError variable is reset...
 
SungSungE:

Can I call script file as OnDeinit/OnInit ?

the code you show is not MQL so won't work...

The easiest thing to do is just incorporate the script into the EA...

 
Paul Anscombe:

the code you show is not MQL so won't work...

The easiest thing to do is just incorporate the script into the EA...

Ya ,Right now I remove the script part , Let it as mqh let EA to include it.

But I think there should be more easy way to integrate different project more easy.


But get some problem DLL loading is not allowed as test ><    

TERMINAL Setting: ALLOW DLL


csv_excel.ini

[Experts]

AllowDllImport=1


void OnStart()

  {

   if(AccountInfoInteger(ACCOUNT_MARGIN_MODE)!=ACCOUNT_MARGIN_MODE_RETAIL_HEDGING)

     {

      Alert("This script can be started only on a retail hedging account (Forex).");

      return;

     }

//---

   if(InpStartDate>InpEndDate)

     {

      Alert("Error: The start date must be earlier than the end date");

      return;

     }



   if(ExportHistoryDeals(InpStartDate,InpEndDate,InpFileName))

     {

      //--- open the .csv file with the associated Windows program

      Execute(TerminalInfoString(TERMINAL_DATA_PATH)+"\\MQL5\\Files\\"+InpFileName);



      Print("History is exported to ",TerminalInfoString(TERMINAL_DATA_PATH)+"\\MQL5\\Files\\"+InpFileName);

     }

  }

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
, then each symbol positions will be closed in the same order, in which they are opened, starting with the oldest one. In case of an attempt to close positions in a different order, the trader will receive an appropriate error. There are several types of accounts that can be opened on a trade server. The type of account on which an...
 


There is a pop up windows can choose enable DLL import as live run EA, but as test there is no pop up window choose DLL ?

 
SungSungE:


There is a pop up windows can choose enable DLL import as live run EA, but as test there is no pop up window choose DLL ?

Try the 2nd tab, not the 3rd.