question

Mischa Spelt avatar image
0 Likes"
Mischa Spelt asked Phil BoBo edited

UserCallback failing

Occasionally I get the following error:

exception: treewin__CallUserCallback
ex: CallUserCallback

I suspect it is coming from calling a nodefunction or evaluating a treenode in a module, but I cannot reproduce it reliably. Usually exceptions give a bit more information but this is really all I get.

Any idea how I could get more information about what specifically is causing the issue, or how to narrow it down? Am I even right about the cause?

FlexSim 17.1.2
exception messagenodefunctionscallusercallback
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Phil BoBo avatar image
0 Likes"
Phil BoBo answered Phil BoBo edited

That is caused by a custom Windows message (FLEXSIM_MESSAGE_USER_CALLBACK) that calls a generic callback function. It could be called from any number of places, including a FlexScript call to sendwindowmessage() or postwindowmessage() or a C++ call to those functions, SendMessage(), or PostMessage(). The software itself uses that custom message in many different places.

Either the callback itself threw an exception and was caught by the callback handler, or the message was passed incorrectly and the handler threw an exception. Either way, it is a generic function that doesn't have any more information to share within the exception message.

To figure out why it is happening, we need to have replication steps so that we can debug where the message is coming from. At the point it is executed, that information is long gone.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.