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

 

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

 

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.

 

Where is the source of "3. Initialization of Variables in .ex5 File"? (SuperClass.mqh; SuperClass.mq5, etc...)
 
VincentX:

Where is the source of "3. Initialization of Variables in .ex5 File"? (SuperClass.mqh; SuperClass.mq5, etc...)
i ask thesame question
Reason: