compilation error?

 

Is it me or it still seems buggy?
I try to call CDealInfo::Ticket(const ulong ticket) from another class which has an instance variable of CDealInfo;

#include "..\DealInfo.mqh"
class a 
  {
   private:
     CDealInfo deal;
   public:
     void Delegate();
  };
void a::Delegate()
  {
   ulong ticket=123;
   deal.Ticket(ticket);  // here there is a compilation error - Ticket - no one of the overloads can be applied to the function call
  }

And get compilation error as stated.
In addition the compiler says: It can't decide which of two methods void Ticket(const ulong ticket) or void Ticket() - to choose from.

 
Amir Yacoby:

Is it me or it still seems buggy?
I try to call CDealInfo::Ticket(const ulong ticket) from another class which has an instance variable of CDealInfo;

And get compilation error as stated.
In addition the compiler says: It can't decide which of two methods void Ticket(const ulong ticket) or void Ticket() - to choose from.


I am no expert by any means, but this

deal.Ticket(deal);

looks like a self reference to me. Can not be good.

 
Enrique Dangeroux:

I am no expert by any means, but this

looks like a self reference to me. Can not be good.

you are right, but it is just a tipo. I edited it, should be deal.Ticket(ticket); // - still the error
 
with pointer (CDealInfo *m_deal_info) it works fine, but why is that have to be a pointer? 
 
Amir Yacoby:
with pointer (CDealInfo *m_deal_info) it works fine, but why is that have to be a pointer? 

The following compiles fine for me in an MQL5 script.

#include <Trade\DealInfo.mqh>   // <<<< Maybe this?
class a 
  {
   private:
     CDealInfo deal;
   public:
     void Delegate();
  };
void a::Delegate()
  {
   ulong ticket=123;
   deal.Ticket(ticket);
  }

Maybe it's your #include statement. See what I used.

Reason: