Support Board
Date/Time: Wed, 27 Nov 2024 12:29:54 +0000
[Programming Help] - ACSIL accessing persistent pointer in another study GetPersistentPointerFromChartStudy
View Count: 447
[2023-08-14 19:46:16] |
dnrich - Posts: 18 |
Hi Support team, I use persistent pointers with dynamic memory allocation and it works fine. Now I need to retrieve this pointer from another study, I thought of using the GetStudyPersistentPointerFromChartStudy() function but it returns a NULL pointer. To make things clearer, I've written the attached simple program which includes 2 studies: 1 the source study, which creates a persistent pointer to an array of integers. 2 the destination study, which should retrieve data from this array using the persistent pointer of source study 1. At the end of the destination study, the pointer value returned by GetPersistentPointerFromChartStudy() is NULL, whereas this function is supposed to return a pointer. Is this correct? I've certainly made a mistake, but I can't find anything in your documentation to help me. GetPersistentPointerFromChartStudy is not documented with example. Could you give me an example or tell me how to use it correctly (what's missing in my attached program to retrieve the data from the source study)? Thank you. |
test-20230814-persistent-var.cpp - Attached On 2023-08-14 19:06:22 UTC - Size: 1.29 KB - 132 views |
[2023-08-14 20:22:56] |
User431178 - Posts: 544 |
Swap ChartStudySource.SetStudyID(0); for ChartStudySource.SetChartStudyValues(0,0); You are accessing the chart number using ChartStudySource.GetChartNumber(), but not actually setting a value. |
[2023-08-15 18:27:07] |
dnrich - Posts: 18 |
Thank you for your quick and efficient reply. Now that's work fine.
|
To post a message in this thread, you need to log in with your Sierra Chart account: