Login Page - Create Account

Support Board


Date/Time: Tue, 24 May 2022 06:35:18 +0000



Post From: Can I persist a custom object?

[2013-05-29 17:34:35]
drmrboyc - Posts: 7
Thank you for your reply!

I tried setting sc.FreeDLL = 0, however, the problem persisted.

I went ahead and stepped through the code just to make sure I knew exactly what was happening.

When the Study is first added to the chart, sc.SetDefaults is true and myObject is properly initialized. When the study is actually run for the first time, myObject is NULL again.

I tried using a pointer instead, but the same thing happened.

Is there anything other than FreeDLL that I can try to persist the object?

Another option, that I thought I might try, is to initialize a pointer of the object, save the memory address into one of SC's PersistVars, then somehow re-point the pointer to that memory address each time the study is run. But that seems really hack-y to me, and I'm sure there's a better way to do it.

Thanks so much for you help!

Kenny