Login Page - Create Account

Support Board


Date/Time: Wed, 15 Jan 2025 23:56:53 +0000



Post From: Question about sc.ChartWindowHandle

[2017-09-26 13:46:54]
GmA - Posts: 20
Dear Support!

It looks sc.ChartWindowHandle and sc.GetChartWindowHandle(sc.ChartNumber) return different handles.
First one returns correct handle of the chart window and the second one the handle of main sierra window (where title is "AT 1615 ..." ).
Is that a normal behavior?

Please find used code below:

SCSFExport scsf_TestWndHandle(SCStudyGraphRef sc)
  {
   SCString MessageString;    
   if (sc.SetDefaults)
    {
     sc.GraphName = "TestWndHandle";
    
    // During development set this flag to 1, so the DLL can be rebuilt without restarting Sierra Chart. When development is completed, set it to 0 to improve performance.
     sc.FreeDLL                     = 1;
     sc.AutoLoop                     = 0; //Auto looping is enabled.
     return;
    }
    
   if (sc.UpdateStartIndex < sc.ArraySize -1)
    {
     MessageString.Format("%s :: Chart Number = %d Chart window Handle = 0x%.08X Chart window Handle from function = 0x%.08X", sc.Symbol.GetChars(), sc.ChartNumber, sc.ChartWindowHandle, sc.GetChartWindowHandle(sc.ChartNumber));
     sc.AddMessageToLog(MessageString,0);
    }

  
  }


When I've set this study to 120 charts (10 charts in 12 automatically loading chart books) and have restarted Sierra, after start sc.ChartWindowHandle returns NULL until sc.UpdateStartIndex will not become equal to (sc.ArraySize - 1) for the first time.
At the same time, sc.GetChartWindowHandle(sc.ChartNumber) returns main Sierra window handle all the time.
Is that normal behavior as well?

Thank you very much in advance
GmA