Hello,
I am currently working on a project where FlexSim has to communicate with an external application. To summarize, when this application sends a message via socket, we create an flowitem in the model() (via the c++ module loaded in flexsim with a dll) then we add labels to this object and finally, we move the flowitem in a queue. As soon as the flowitem enters the queue, it generates a token in a processflow and the simulation goes on...
The problem I have now is that I have a "Stack overflow detected" error randomly when calling the moveobject function. As I say, this exception is random, I can generate a hundred objects without any problem but after a while, the exception is generated.
In the model tree, I can see is that the object is not moved in the queue (still in the root of the tree). After that the whole c++ module seems to stop working (If I don't catch the exception, the whole program crashes).
What would you recommend to avoid this mistake? I have already tried some things, whithout success :
- Use insertcopy and then destroy
- Create directly the object in the queue (but by adding the labels after, the results are not good in the simulator)
Thank you.