In an effort to simplify the problem I am having, I have included two classes in foo.mqh
and bar.mqh
.
When I compile them, I get:
'bar' - wrong parameters count foo.mqh Line 20 Column 9
which is this line in foo.mqh
:
foobar(bar & b) { example = b;}
I have read up on other posts that deal with this error, but they don't seem to be object oriented and I can't correllate those instances with this one.
Is it that bar has a default value? .... because of the constructor? Actually that is probably not it because if I put them in the same file I get the same error.
Is there anyway to get around this?
Any help would be appreciated. Thanks
bar.mqh
#property copyright "Copyright 2015, MetaQuotes Software Corp." // 01
#property link "https://www.mql5.com" // 02
#property strict // 03
// 04
class bar{ // 05
private: // 06
int b; // 07
int u; // 08
int g; // 09
public: // 10
bar * operator=(const bar & example) // 11
{ // 12
b = example.b; // 13
u = example.u; // 14
g = example.u; // 15
return GetPointer(this); // 16
} // 17
bar(bar & example) // 18
{ // 19
b = example.b; // 20
u = example.u; // 21
g = example.u; // 22
} // 23
// 24
}; // 25
foo.mqh
#property copyright "Copyright 2015, MetaQuotes Software Corp." // 01
#property link "https://www.mql5.com" // 02
#property strict // 03
// 04
// 05
#include<bar.mqh> // 06
// 07
class foo { // 08
}; // 09
// 10
class foobar: public foo { // 11
private: // 12
bar example; // 13
public: // 14
foobar(bar & b) { example = b;} // 15
bar getExample() { return example; } // 16
}; // 17