Libraries: MultiTester - page 20

 

A tricky error with a heap crash that seems to have lived for a long time.

    ::ArrayResize(Buf, (int)user32::SendMessageW(Handle, CB_GETLBTEXTLEN, 0, 0 ));
    user32::SendMessageW(Handle, CB_GETLBTEXT, 0, Buf);

CB_GETLBTEXTLEN: The return value is the length of the string, in TCHARs, excluding the terminating null character

CB_GETLBBTEXT: The buffer must have sufficient space for the string and a terminating null character

You should write

::ArrayResize(Buf, (int)user32::SendMessageW(Handle, CB_GETLBTEXTLEN, 0, 0 )+1);
 
traveller00:

A clever mistake with a pileup that seems to have lived a long time.


CB_GETLBTEXTLEN: The return value is the length of the string, in TCHARs, excluding the terminating null character

CB_GETLBBTEXT: The buffer must have sufficient space for the string and a terminating null character

You should write

Thanks! True, GetExpertName, where this is used, has become almost a rudiment.

 
fxsaber:

GetExpertName, where it is used, has become almost a rudiment.

How to say, it is used in SetExpertName, which is yanked from Run, and it is in fact one of the main functions in MultiTester. Although the error is rare, I came across it by accident.

 
traveller00:

How to say, it is used in SetExpertName, which is pulled from Run, and it is in fact one of the main functions in MultiTester. Although the error appears rarely, I came across it by accident.

Hasn't been that way for a while now.

 
    Str += iBeginTime ? "FromDate==" + ::TimeToString(iBeginTime, TIME_DATE) + "\n" : NULL;
    Str += iEndTime ? "ToDate==" + ::TimeToString(iEndTime, TIME_DATE) + "\n" : NULL;

Extra equals signs in "FromDate==" and "ToDate==" ?

 
traveller00:

Extra equals signs in "FromDate==" and "ToDate==" ?

Unnecessary, thank you.

 
Hello. I am using MultiTester as a WFO with a standard forward, but the standard 1/4 period divider is not enough. I'm trying to understand your code and teach MultiTester to fill the date field of the forward, but I can't do it without OOP knowledge. I have reached the Run() function in the MTTester file. I don't understand further. All parameters are glued into one line and passed to SetSettings2 and SetSettings, where they are multiplied and passed to the clipboard. Can you tell me what else I need to correct if another parameter appears in the string and where MultiTester inserts the data into the window? I would add one more window handle and the forward date text.
And at the same time, please tell me about the purpose of INITDEINIT fInit and INITDEINIT fDeinit in the TesterSettings.Add() function.
 
Good Beer:
Hello. I am using MultiTester as a WFO with a standard forward, but the standard 1/4 period divider is not enough. I'm trying to understand your code and teach MultiTester to fill the date field of the forward, but I can't do it without OOP knowledge. I have reached the Run() function in the MTTester file. I don't understand further. All parameters are glued into one line and passed to SetSettings2 and SetSettings, where they are multiplied and passed to the clipboard. Can you tell me what I need to correct if another parameter appears in the line and where MultiTester inserts the data into the window?

In the Tester->Settings tab press CTRL+C and then in a text editor press CTRL+V. You will see all the settings of the Tester.

ForwardMode
ForwardDate

These two parameters are responsible for the forward (the second is relevant when the first is 4).


MTTester manages the Tester settings via the clipboard, creating what you see in the text editor by CTRL+V.

 
fxsaber:


MTTester manages the Tester settings via the clipboard, creating what you see in a text editor by CTRL+V.

Thank you.

The task is clear: find the right line by count from the top and replace it with the required text.

 
Good Beer:

The task is clear: find the right line from the top and replace it with the required text.

The line number changes and is not important.

  static bool Run( const string ExpertName = NULL,
                   const string Symb = NULL,
                   const ENUM_TIMEFRAMES period = PERIOD_CURRENT,
                   const datetime iBeginTime = 0,
                   const datetime iEndTime = 0,
                   const int ForwardMode = 0 )
  {
    string Str = "[Tester]\n";

    Str += (ExpertName != NULL) ? "Expert=" + ExpertName + "\n" : NULL;
    Str += (Symb != NULL) ? "Symbol=" + Symb + "\n" : NULL;
    Str += iBeginTime ? "FromDate=" + ::TimeToString(iBeginTime, TIME_DATE) + "\n" : NULL;
    Str += iEndTime ? "ToDate=" + ::TimeToString(iEndTime, TIME_DATE) + "\n" : NULL;
    Str += "ForwardMode=" + (string)ForwardMode + "\n";

    return(MTTESTER::SetSettings2(Str) &&
           MTTESTER::SetTimeFrame(period) && MTTESTER::ClickStart());