Download MetaTrader 5

Failure " 'xy' - struct member undefined " while simply read a MemberVariable ?

To add comments, please log in or register
Publish your article. We will translate it into other languages!
Abejorro
165
Abejorro 2015.01.26 12:17 

Hello,

I've tried to use a very simple OOP in MT4 beyond #600. So, nearly everthing works :-)

But with that it`s funny:

File 1 as "Test.mqh" in the include-directory:

--------------------------------

class Test
  {
public:
                     int getData() {return 12;};

  };

--------------------------------

File 2 is going to use that simple stuff:

--------------------------------

#include <Test.mqh>

class HuBreak
  {

public:

                 HuBreak();    

  };
 
HuBreak::HuBreak()
  {
  Test mtest;
  int l = mtest.getData;      // hier is the error pointed "'xy' - struct member undefined"
  }
 

 --------------------------------

So, I'm done. What`s missing ??

Thx a lot !

Alain Verleyen
Moderator
30743
Alain Verleyen 2015.01.26 13:41  
  int l = mtest.getData();   
Abejorro
165
Abejorro 2015.01.26 13:57  

Oh no, this is cruel simple !      You made the fix - Thanks a lot !

(coding and trading won`t work same time - I'll take a coffee)

stahm007
25
stahm007 2015.03.30 17:35  

Hi Angevoyageur,

i have similar error

    if(Pos.PriceCurrent>=(NormalizeDouble(i*Target_Increment+NormalizeDouble(First_Stop+Pos.PriceOpen,_Digits),_Digits)))


I have included the following at the heading

#include <Trade/Trade.mqh>
#include <Trade/SymbolInfo.mqh>
#include <Trade/DealInfo.mqh>
#include <Trade/PositionInfo.mqh>

CTrade Trade;
CDealInfo Deal;
CSymbolInfo Sym;

CPositionInfo Pos;


regards

Stuart Browne
5816
Stuart Browne 2015.04.08 10:10  

Problem solved in another post.   

To add comments, please log in or register