Notifications
Clear all
[Closed] DotNet eventhandler broke after file reset
Sep 15, 2011 11:16 am
Hi,
I’ve discovered a problem with any eventhandler on a dotNetObject added via dotNet.addEventHandler Mybutton “click” MyAction
which usually works fine but after I do a reset file in max the DotNetEventHandler doesn’t call MyAction() any more.
The only solution I found so far is to restart the dialog and reinitialising all event handlers…
Is there a way to prevent this?
Thanks,
Stefan
4 Replies
Sep 15, 2011 11:16 am
Did you try if your event handlers also break when performing a garbage collection, gc()?
They have to be stored into a global variable.
Sep 15, 2011 11:16 am
lookup DotNet Objects and Classes Life Time Control in the mxs reference. you need to set the event lifetime to #dotnet
Sep 15, 2011 11:16 am
Thanks Gravey,
the dotNet.setLifeTimeControl was the solution i searched for!
Regards,
Stefan