status = ProArrayAlloc(0, sizeof(ProWstring), 1, (ProArray*)&w_array);
|The initial number of objects allocated in the array.|
|The size of each object in the array|
|The minimum number of objects added or deleted if Creo Parametric TOOLKIT resizes the array, e.g. on a call to ProArrayObjectAdd.|
|The allocated array|
After that you can add elements by:
status = ProArrayObjectAdd(w_array, PRO_VALUE_UNUSED, 1, p_object );
Don't forget to free it at the end of the life cycle.
status = ProArrayFree((ProArray*)&w_array);
easiest way is to use std. c++ ways like vectors, maps, such kind of stuff : )
If you need it as a "Creo like" way I don't know ^.^ I was never in need of that.
But I think you can use an xanysequence. As alternative you can use xlongsequence and fill it with pointers to the objects you have allocated. So I'm not so sure about the size, if it didn't fit for pointers you could use xrealsequence, cause xreal is defined as a "real C++" double, that should be 8Byte --> 64 Bit and so same size as your pointer.
Eike's answer is the correct one. You are dealing with the usual serialization/deserialization issues when packing your classes into ProArray. The easiest way is to create a c++ std container for your custom class and store pointers to the container elements in ProArray - this is very similar technique as Pro/Toolkit ProNote-Text handling...