Yes, that's something I've already discovered. But the problem is (was) that in the source this memeber is actually an array, and I decided to deal with the scalar first for simplicity. However, for the array the same trick doesn't work. I had to drag the array statically inside the member function.
//Test.mqhclass A {};
class B { public:
B() { f(); }
A *g() { returnNULL; }
void f()
{
void *x = g();
if ( true )
return;
delete x; //в build 1650 не работает даже если до delete никогда (!) не доходит
//а ошибка при выполнении возникает именно из-за наличия этой строки
//и указатель в исходном коде действительный (есть проверка)
}
};
//Test.mq5#include "Test.mqh"#import "Test2.ex5"
A *f();
#import
voidOnStart()
{
f();
}
//Test2.mq5#property library#include "Test.mqh"static B b;
A *f() export { returnNULL; }
//Test.mq5class A;
#import "Test2.ex5"
A *f();
void g( A* );
#import
voidOnStart() //вариант 1
{
f(); /*возвращаемое значение не используется*/
}
//Test2.mq5#property libraryclass A {};
static A *a;
A *f() export { /*делает что-то полезное*/; return a; }
void g( A* ) export { /*делает что-то полезное*/; }
The library is general in nature. By the way, the returned f() pointer is not used in this case - option 1 (but can be used - see option 2 below). When compiling Test.mq5 there are no error messages - it means the compiler doesn't need to define the class (A). Nevertheless, there is an error during execution: Cannot find 'f' in 'Test2.ex5'.
Further on
voidOnStart() //вариант 2
{
g( f()/*возвращаемое значение используется*/);
}
Can you tell me if it is possible to set the relative drawdown instead of the maximum drawdown in the test results? But often the maximal drawdown is 3-5% and relative drawdown reaches 50%. And to see the relative drawdown should be tested separately. Thanks in advance
It's OK if you can get it to compile and run in the pros )
I don't really understand what's wrong with it. Everything works.
I don't really understand what's wrong with it. Everything works.
Forum on trading, automated trading systems and trading strategy testing
Bugs, bugs, questions
A100, 2017.08.17 18:45
Yes, that's something I've already discovered. But the problem is (was) that in the source this memeber is actually an array, and I decided to deal with the scalar first for simplicity. However, for the array the same trick doesn't work. I had to drag the array statically inside the member function.
However, the same trick doesn't work for an array. I had to drag the array statically inside the member function.
This is already a compiler error - we should tell Service Desk
build 1650. If several related .ex5 modules (main and library), nothing works at all. Everywhere there is an error of the form:
2017.08.18 01:49:59.759 Draw (USDJPY,H1) Cannot find 'xxx' in 'yyyy.ex5'
Everything was working fine before. Even now, when compiling MetaEditor 1646 + MetaTrader 1650, everything works
Obviously there is an error in MetaEditor 1650, while .ex5 files are almost twice as thin. Why such experiments?
Adding code
The result is in the previous post
The library is general in nature. By the way, the returned f() pointer is not used in this case - option 1 (but can be used - see option 2 below). When compiling Test.mq5 there are no error messages - it means the compiler doesn't need to define the class (A). Nevertheless, there is an error during execution: Cannot find 'f' in 'Test2.ex5'.
Further on
The Windows language needs to be changed to be happy...