Support Board
Date/Time: Thu, 06 Mar 2025 13:05:51 +0000
Post From: How to create my own class and use it correctly?
[2022-01-29 15:06:22] |
Diego - Posts: 3 |
I test these: in "Waves.h" class SmallWaves { public: SmallWaves(); ~SmallWaves(); void test(); }; SmallWaves::SmallWaves() {} SmallWaves::~SmallWaves() {} void SmallWaves::test() { float temp = 0; } #include "Waves.h" #include "sierrachart.h" SCDLLName("My Studies") SCSFExport scsf_TemplateFunction(SCStudyInterfaceRef sc) { SCSubgraphRef SmallWavesTop = sc.Subgraph[0]; SCSubgraphRef SmallWavesBottom = sc.Subgraph[1]; SCFloatArrayRef Open = sc.BaseData[SC_OPEN]; SCFloatArrayRef Close = sc.BaseData[SC_LAST]; SCFloatArrayRef High = sc.BaseData[SC_HIGH]; SCFloatArrayRef Low = sc.BaseData[SC_LOW]; // Section 1 - Set the configuration variables and defaults if (sc.SetDefaults) { sc.GraphName = "威科夫波浪"; sc.AutoLoop = 1; //Automatic looping is enabled. SmallWavesTop.Name = "上升浪"; SmallWavesTop.DrawStyle = DRAWSTYLE_TRANSPARENT_FILL_RECTANGLE_TOP; SmallWavesTop.PrimaryColor = RGB (50, 91, 212); SmallWavesBottom.Name = "下降浪"; SmallWavesBottom.DrawStyle = DRAWSTYLE_TRANSPARENT_FILL_RECTANGLE_BOTTOM; SmallWavesBottom.PrimaryColor = RGB (255, 0, 255); //sc.Input[0].Name = "Float Input"; //sc.Input[0].SetFloat(0.0f); return; } SmallWaves wave(); wave.test(); } Wave.cpp: In function 'void scsf_TemplateFunction(SCStudyInterfaceRef)': Wave.cpp:35:7: error: request for member 'test' in 'wave', which is of non-class type 'SmallWaves()' 35 | wave.test(); | ^~~~ |