On 27/01/2015 at 15:08, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R15
Platform: Windows ;
Language(s) : C++ ;
---------
I like to send a struct with information using SpecialEventAdd and BFM_CORE_PAR2.
But I can not get it to work. A single value is ok, but a struct is not working
Here the sending part (the compiler is not complaining) :
struct PolyData
{
Vector p1;
Vector p2;
Vector p3;
Vector p4;
Int32 polyIndex;
};
PolyData polys;
polys.polyIndex = polygonid;
polys.p1 = Vector(1,0,0);
polys.p2 = Vector(2,0,0);
polys.p3 = Vector(3,0,0);
polys.p4 = Vector(4,0,0);
SpecialEventAdd(OCTREE_ID, OCTREE_ID, (UInt) &polys );
If I use SpecialEventAdd(OCTREE_ID, OCTREE_ID, (PolyData * ) &polys ) the compiler start to complain.
The receiving part in CoreMessage:
PolyData* my_data = (PolyData * ) msg.GetVoid( BFM_CORE_PAR2 );
GePrint("Polygon id: " + String::IntToString(my_data->polyIndex));
For the compiler it is ok, but I do not receive the expected values. Mostly rubbish.
If I use (UInt) msg.GetVoid( BFM_CORE_PAR2 ) the compiler starts to complain.
So, I guess something goes wrong because when sending I use (UInt) and when receiving I use (PolyData * ).
How to solve this issue?
-Pim