I'm using C++ Builder 12 and ImageEn 13.2.0
My app programmatically creates layers and will also change their Z order by using the LayersArrange function.
To keep track of the Layers, I use this code (modern C++):
auto layer = display->LayersAdd(ielkPolyline, 0, 0);
auto pLayer = dynamic_cast<TIEPolylineLayer*>(display->Layers[layer]);
Here layer is the index of the layer, when it is created. pLayer is a pointer to the actual layer.
Simple question - is it safe to retain the pLayer pointer, so I can access it to change its color, etc?
My worry is the pointer might become invalid if ImageEn does some internal memory reorganisation. It doesn't seem practical, with dozens of layers, for me to use layer index numbers, which seem to change after a call to LayersArrange...
Is my approach safe?
Thanks.
Andy Bell