Need file .mqh - page 2

 
Can you tell what is printed by MQLInfoString(MQL_PROGRAM_PATH) and where in your terminal folder are the .mqh files?
 
rom #:
Thank you! Actually from the MQLInfoString(MQL_PROGRAM_PATH) function, you get the path to the .ex5 file. I need the .mqh one. I think it's a matter of implementing a C++ function on .mqh file. C++ is a  language that unfortunately I don't know.

Basically .mq5 should call the .mqh file, which should in turn execute the command as if it were a main class. But I'm afraid this cannot be done in the MT5 context, or can it?

As I already anticipated I know the .mqh path but I need to trace back to that path via code.
Mq5  and mqh are source files.  When you compile the ex5 will be a compiled executable file including all source. So it will not be calling or executing the mqh file as it already contains what it needs from there grabbed at time of compile 
 
rom #: I know the .mqh path but I need to trace back to that path via code.

If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.

You have been given the code. Call it. Show us your attempt (using the CODE button) and state the nature of your difficulty.
          No free help (2017)

 
rom #:
Thank you! Actually from the MQLInfoString(MQL_PROGRAM_PATH) function, you get the path to the .ex5 file. I need the .mqh one. I think it's a matter of implementing a C++ function on .mqh file. C++ is a  language that unfortunately I don't know.

Basically .mq5 should call the .mqh file, which should in turn execute the command as if it were a main class. But I'm afraid this cannot be done in the MT5 context, or can it?

As I already anticipated I know the .mqh path but I need to trace back to that path via code.

Well you actually can . Here is how to test it 

  • Create a subfolder in your experts folder called "forum" 
  • Place trace_function_in_mqh.mq5 in that folder
  • Place trace.mqh in the same folder (this is the native one)
  • Create a sub folder in forum folder called ... "subfolder" :)
  • Navigate in that subfolder , place trace_subfolder.mqh in there 
  • Go to the includes folder , place trace_include.mqh in there

Now , compile trace_function_in_mqh.mq5 , you get an ex5.

Run it , it will give you the result of the following 4 string commands from  each different call revealing the location name and function that was executed inside the mqh file 

BUT (there's always at least one) this means your call function must be inside the mqh and you cannot trace a function that runs from another mqh .

Hope that was clear and as @Carl Schreiber and Paul Anscombe stated can't be done (trace what runs from where and its location if not called directly from that include)

here are the bits in the test , i'm not as advanced as the other guys so i don't know if these stop working when the ex5 is only present . 

string func_file=__FILE__;
string func_sig=__FUNCSIG__;
string func_func=__FUNCTION__;
string func_path=__PATH__;
Print("Func file : ["+func_file+"]");
Print("Func sig  : ["+func_sig+"]");
Print("Func func : ["+func_func+"]");
Print("Func path : ["+func_path+"]");

Here are the files . Cheers :)

 
William Roeder #:

You have only four choices:

  1. Search for it (CodeBase or Market). Do you expect us to do your research for you?

  2. Beg at:

  3. MT4: Learn to code it.
    MT5: Begin learning to code it.

    If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.

  4. Or pay (Freelance) someone to code it. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum (2019)

We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
          No free help (2017)

This message is in violation of Rule 1 of the forum . 

We may be familiar with Williams tone but a user who is not often posting here is not . Kudos to the OP for being mature and just ignore it .

https://www.mql5.com/en/about/rules

Rules
Rules
  • www.mql5.com
Rules of using the MQL5.com website
 
Lorentzos Roussos #:

Well you actually can . Here is how to test it 

  • Create a subfolder in your experts folder called "forum" 
  • Place trace_function_in_mqh.mq5 in that folder
  • Place trace.mqh in the same folder (this is the native one)
  • Create a sub folder in forum folder called ... "subfolder" :)
  • Navigate in that subfolder , place trace_subfolder.mqh in there 
  • Go to the includes folder , place trace_include.mqh in there

Now , compile trace_function_in_mqh.mq5 , you get an ex5.

Run it , it will give you the result of the following 4 string commands from  each different call revealing the location name and function that was executed inside the mqh file 

BUT (there's always at least one) this means your call function must be inside the mqh and you cannot trace a function that runs from another mqh .

Hope that was clear and as @Carl Schreiber and Paul Anscombe stated can't be done (trace what runs from where and its location if not called directly from that include)

here are the bits in the test , i'm not as advanced as the other guys so i don't know if these stop working when the ex5 is only present . 

Here are the files . Cheers :)

Hi! thank you! I really appreciated your intervention. It works perfectly. I am reading the paths and that is what I was looking for. Your intervention was very valuable.
 
rom #:
Hi! thank you! I really appreciated your intervention. It works perfectly. I am reading the paths and that is what I was looking for. Your intervention was very valuable.

Anytime :)