[help] how to include files mq4

 

I'm trying to learn how to include files to my experts

code of library:

#property copyright "mit"

#property link ""

#property library

int abra ()

{

return(2);

}

code of ea:


#property copyright "mit"

#property link ""


#import "mgk.mq4"

int abra ();

#import

int init()

{

//----

//----

return(0);

}

int deinit()

{

//----

//----

return(0);

}


int start()

{

//----

Print(abra());

//----

return(0);

}


but so it does not work

 


  1. You're not including anything your importing big difference. #include "file.mq4" is the same thing as pasting the code at that location
  2. You do NOT import source code you'd import the file.ex4 or file.dll
 

thanks. I tried to replace the code with includes but

'mgk.mqh' - cannot open the program file C:\Program Files (x86)\MetaTrader Admiral Markets AS\experts\dllcarica.mq4 (10, 1)

(I tried several times to save the library in different directories. expert / include)

the code changed :

#property copyright "la turca"
#property link      ""

#include <WinUser32.mqh>
#include "mgk.ex4"

i olso tried with mgk.ex4, mgk.mqh

 
  1. Do NOT install in \program file* on Vista/Win7
  2. You can NOT include executables. Re-Read the docs. you include source code not binary. You Import binary functions not source code.