Login Page - Create Account

Support Board


Date/Time: Sat, 11 May 2024 04:19:33 +0000



[User Discussion] - Question about sc.ChartWindowHandle

View Count: 987

[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
[2017-09-26 17:26:14]
Sierra Chart Engineering - Posts: 104368

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?
This will be solved in the next release.


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.
What we find is that the handle is nonzero when the study is first calculated after opening a Chartbook. So we cannot reproduce this. Really does not make sense for this condition to occur.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account