We are working “MileStone Component Integration” using MIP SDK and trying develop a 32bit WPF application that will interact with MileStone VMS. Our application will be attached as a plug-in to an existing mother application. Goal is to show the camera streaming from the plug-in application.
Now the plug-in is working fine when we tested it as an standalone WPF application. But when we attached the plug-in with the existing mother application and try to show the streaming, system encounters the following exception at the time of running the statement: _imageViewerControl.Initialize();
System.NullReferenceException was unhandled
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=VideoOS.UI.Common.WPF.VideoPlayer
StackTrace:
at VideoOS.UI.Common.WPF.VideoPlayer.Toolkit.VideoImage.VideoImageManager.VideoImageUpdateRenderingParameters(VideoImage videoImage, IRenderingParameters renderingParameters)
at VideoOS.UI.Common.WPF.VideoPlayer.Toolkit.VideoImage.VideoImage.UpdateRenderingParameters(List\`1 renderingParameters)
at VideoOS.UI.Common.WPF.VideoPlayer.Toolkit.ToolkitVideoSource.UpdateRenderingParameters(List\`1 renderingParameters)
at VideoOS.Platform.SDK.UI.PlatformImageViewerWpfControl.SetBufferingParameters(String bstrBufferingParameters)
at VideoOS.Platform.SDK.UI.PlatformImageViewerWpfControl.ImageViewerUpdateState()
at VideoOS.Platform.SDK.UI.PlatformImageViewerWpfControl.Initialize()
at VideoOS.Platform.Client.ImageViewerWpfControl.Initialize()
My code for the live camera streaming is as follows:
_imageViewerControl.CameraFQID = _selectedMileStoneItem.FQID;
_imageViewerControl.Initialize(); // generates the null reference exception
_imageViewerControl.Connect();
_imageViewerControl.Selected = true;
_imageViewerControl.StartLive();
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(
VideoOS.Platform.Messaging.MessageId.System.ModeChangeCommand,
Mode.ClientLive), \_selectedMileStoneItem.FQID);
I was wondering what are the possible reasons for this exception.