I have written clearly in a better way in post #11 what I want!
The code:
results in:
template mismatch test.mqh 62 15
'actionWithSettingActTrade' - cannot to apply template test.mqh 62 15
How to solve?
The code:
Inserted Code
//***********************************************************************************************
// For test just a simple class and one instance of it: x
// I want to call several instance dependent on settings so it has to be this way!
//***********************************************************************************************
class Cx{
public:
void f(){
}
};
Cx x();
//***********************************************************************************************
// My test class with methods
//***********************************************************************************************
class CTest{
public:
//*******************************************************************
// buy
//******************************************************************
template <typename T> void buy(T t){
// coding here with "t"
};
//***********************************************************************************************
// verifyAndCloseBuy
//***********************************************************************************************
bool verifyAndCloseBuy(int i){
// Calling method "buy" with instance object x: works 100%
this.buy(&x);
return false;
}
//***********************************************************************************************
// getActTrade
//***********************************************************************************************
template <typename T> void getActTrade(T actTrade){
// Set my Object to actTrade
actTrade=&x;
}
//***********************************************************************************************
// verifyAndCloseOpenOrdersEA
//***********************************************************************************************
template <typename T> void actionWithSettingActTrade(){
T actTrade;
getActTrade(actTrade);
this.buy(actTrade);
};
};
CTest test();
//***********************************************************************************************
// Call outside the class
//***********************************************************************************************
void testAll(){
// The rest is compiled......
test.actionWithSettingActTrade();
} results in:
template mismatch test.mqh 62 15
'actionWithSettingActTrade' - cannot to apply template test.mqh 62 15
How to solve?
Attached Image
Attached File(s)
Vucking good EA coder... https://t.ly/AZjRM