Download MetaTrader 5
To add comments, please log in or register
Find out how to add a video in the messages editor
Pavel Soukup
559
Pavel Soukup 2014.08.05 09:51 

Hi guys,

I have this code:

#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

#import "libutm2.ex4"
  int InitLibrary();
  int My2(int, int);
  int Calc_Count2(int, int);
#import

#import "test.ex4"
   int GetPaneHeights(double &height[]);
   int Calc_Count(int, int);
   int Calc_Objects(int ,int);
   int View(string);
   double Calc_Stats(double , double );
#import


void OnStart()
  {
    Alert(GetLastError());
    int init_lib=0;
    init_lib=InitLibrary();
    Alert(GetLastError());
    Alert("Init Library: ",init_lib);
    Alert("Calc_Count..2 ",Calc_Count2(3,10), " ");
    Alert("Script..2..",My2(10,10));
  }

 If files test.ex4 and libutm2.ex4 are in directorie MQL4/Libraries - script is running ok.

When I delete once *.ex4 (example libutm.ex4), code freezes on row: init_lib=InitLibrary();

Unfortunatelly GetLastError() return value zero... :-(

 

My idea how I want code works:

declaration...

...#import ".... .ex4"

...#import ".... .ex4" 

void OnStart()

{

  if (Files1_Libraries_exist) { ...go... } 

  else {... go other...} 

  if (Files2_Libraries_exist) { ...go... } 

  else {... go other...} 

 } 

 

 I need different which file missing. How get it?

Thank you for help me.

Endy 

qjol
3243
qjol 2014.08.05 21:43  
Alain Verleyen
Moderator
28701
Alain Verleyen 2014.08.06 12:14  
Can't be used to check a file in MQL4\Libraries, only in MQL4\Files.
/
To add comments, please log in or register