Download MetaTrader 5

Discussion of article "Promote Your Development Projects Using EX5 Libraries"

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
182618
MetaQuotes Software Corp. 2012.02.20 13:13 

New article Promote Your Development Projects Using EX5 Libraries is published:

Hiding of the implementation details of classes/functions in an .ex5 file will enable you to share your know-how algorithms with other developers, set up common projects and promote them in the Web. And while the MetaQuotes team spares no effort to bring about the possibility of direct inheritance of ex5 library classes, we are going to implement it right now.

Scheme for working with methods of the library classes

Author: Alex Sergeev

Rashid Umarov
Admin
11994
Rashid Umarov 2012.03.30 11:18  

You may be interested to know that MetaEditor 5 has the special command that allows you to generate include files of the exported functions in a current file.


Generating Include Files

MetaEditor has a special feature for generating include files (*.mqh) on the basis of exported functions of the current file. To start this function, you should execute the "Generate Include File Generate Include File" command of the "Tools" menu.

The Process of Generation

The generation of a mqh file is performed in the following way:

  • In the currently open file, all functions with the export post modifier are searched for.
  • An mqh file that contains the #import directive and the description of the functions found is generated.
  • If no exported functions are found, the corresponding dialog is displayed.
  • If the source file is located in the /Libraries folder, then the module name in the #import directive will contain the path relatively to the /Libraries directory. If the file is located in another directory, #import will include only the name of the ex5 file.

If the current file is an include file (*.mqh), the command of generation is disabled.

The Path of Generation

A folder where mqh files are generated depends on location of the source files:

  • If a source file is in the /Libraries directory or in one of its subfolders, the include file will be generated in the root of the /Include folder.
  • If a source file is in another folder, the include file will be generated in the same place.

Using MQH Files

The function of generating include files allows to easily share your functions with other users without exposing the source code. To do it, it's enough to provide the generated mqh file and the ex5 file where the functions are implemented.

Gabor Torma
2680
Gabor Torma 2012.10.27 10:04  

Where is the source of "3. Initialization of Variables in .ex5 File"? (SuperClass.mqh; SuperClass.mq5, etc...)
Moses Olawale  Ajayi
2398
Moses Olawale Ajayi 2012.10.27 12:03  
VincentX:

Where is the source of "3. Initialization of Variables in .ex5 File"? (SuperClass.mqh; SuperClass.mq5, etc...)
i ask thesame question
To add comments, please log in or register