Threading problem between two backgroundplugins.

I have two Backgroundplugins running one on event sever and one on SmartClient.

I do the communication from server plugin to SC plugin via MessageCommunicationManager. This works fine. In SC plugin I use “_msgCommunication.RegisterCommunicationFilter(new MessageReceiver(ChangedAlarmMessageHandler), new CommunicationIdFilter(MessageID_FireDetectionClientComm));”. In the “ChangedAlarmMessageHandler” I unpack all information I need and call a function for removing a camera from a floating window. Here I use the function “_viewAndLayoutItem.InsertBuiltinViewItem(item.Index, ViewAndLayoutItem.CameraBuiltinId, properties);” and if I call this function I get a threading error. Calling this function from this event “_manager.RegisterReceiver(new MessageReceiver(NewAlarmMessageHandler), new MessageIdFilter(MessageId.Server.NewAlarmIndication));” works without problems.

I found nothing to invoke this in a background plugin.

What can I do to solve this problem?

I think you are on the right track. Try to use

virtual void VideoOS.Platform.ClientControl.CallOnUiThread (Action actionToBeInvoked )

http://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_client_control.html&tree=tree_search.html?search=clientcontrol

Very cool, this was the function I needed. :blush: